#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 pow(int, double);
int /*<<< orphan*/ printf(char *, int, double);
int /*<<< orphan*/ scanf(char *, double *);
int main() {
  double N, resu[100];
  int cont = 0, i;
  scanf(" %lf", &N);
  while (N != 0) {
    resu[cont] = pow(2, N) - 1;
    cont++;
    scanf(" %lf", &N);
  }
  i = 0;
  while (i < cont) {
    printf("\nTeste %d\n%0.0lf\n", i + 1, resu[i]);
    i++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x340,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x334(%rbp)
lea    0xead(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1179 <main+0x49>
jp     1179 <main+0x49>
jmp    11c3 <main+0x93>
movsd  -0x10(%rbp),%xmm0
mov    $0x2,%edi
call   1050 <pow@plt>
sub    $0x1,%eax
cvtsi2sd %eax,%xmm0
movslq -0x334(%rbp),%rax
movsd  %xmm0,-0x330(%rbp,%rax,8)
ff ff
mov    -0x334(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x334(%rbp)
lea    0xe4b(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
jmp    115c <main+0x2c>
movl   $0x0,-0x338(%rbp)
mov    -0x338(%rbp),%eax
cmp    -0x334(%rbp),%eax
jge    1218 <main+0xe8>
mov    -0x338(%rbp),%esi
add    $0x1,%esi
movslq -0x338(%rbp),%rax
movsd  -0x330(%rbp,%rax,8),%xmm0
ff ff
lea    0xe06(%rip),%rdi
call   1030 <printf@plt>
mov    -0x338(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x338(%rbp)
jmp    11cd <main+0x9d>
xor    %eax,%eax
add    $0x340,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x330,%rsp
lea    0xebd(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1040 <scanf@plt>
movsd  0x8(%rsp),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    115f <main+0x2f>
jnp    11d9 <main+0xa9>
xor    %ebx,%ebx
lea    0xe98(%rip),%r14
lea    0x8(%rsp),%r15
nopl   (%rax)
mov    $0x2,%edi
call   1050 <pow@plt>
add    $0xffffffff,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x10(%rsp,%rbx,8)
add    $0x1,%rbx
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <scanf@plt>
xorpd  %xmm1,%xmm1
movsd  0x8(%rsp),%xmm0
ucomisd %xmm1,%xmm0
jne    1170 <main+0x40>
jp     1170 <main+0x40>
test   %ebx,%ebx
je     11d9 <main+0xa9>
mov    %ebx,%r15d
xor    %ebx,%ebx
lea    0xe4a(%rip),%r14
nopl   0x0(%rax,%rax,1)
movsd  0x10(%rsp,%rbx,8),%xmm0
add    $0x1,%rbx
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
cmp    %rbx,%r15
jne    11c0 <main+0x90>
xor    %eax,%eax
add    $0x330,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c" %lf\00"
@.str.1 = [18 x i8] c"\0ATeste %d\0A%0.0lf\0A\00"
define i32 @main() {
%1 = alloca double
%2 = alloca [100 x double]
%3 = bitcast double* %1 to i8*
%4 = bitcast [100 x double]* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double* %1)
%6 = load double, double* %1
%7 = fcmp une double %6, 0.000000e+00
br i1 %7, label %13, label %32
8: ; preds = %13
%9 = trunc i64 %20 to i32
%10 = icmp eq i32 %9, 0
br i1 %10, label %32, label %11
11: ; preds = %8
%12 = and i64 %20, 4294967295
br label %24
13: ; preds = %0, %13
%14 = phi i64 [ %20, %13 ], [ 0, %0 ]
%15 = phi double [ %22, %13 ], [ %6, %0 ]
%16 = call i32 @pow(i32 2, double %15)
%17 = add nsw i32 %16, -1
%18 = sitofp i32 %17 to double
%19 = getelementptr inbounds [100 x double], [100 x double]* %2, i64 0, i64 %14
store double %18, double* %19
%20 = add nuw i64 %14, 1
%21 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double* %1)
%22 = load double, double* %1
%23 = fcmp une double %22, 0.000000e+00
br i1 %23, label %13, label %8
24: ; preds = %11, %24
%25 = phi i64 [ 0, %11 ], [ %26, %24 ]
%26 = add nuw nsw i64 %25, 1
%27 = getelementptr inbounds [100 x double], [100 x double]* %2, i64 0, i64 %25
%28 = load double, double* %27
%29 = trunc i64 %26 to i32
%30 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %29, double %28)
%31 = icmp eq i64 %26, %12
br i1 %31, label %32, label %24
32: ; preds = %24, %0, %8
ret i32 0
}