#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, int);
int main() {
  int tab[5] = {2};
  int i;
  int pow = 2;
  for (i = 1; i <= 4; i = i++) {
    tab[i] = tab[i - 1] * pow;
  }
  for (i = 4; i >= 0; i = i - 1) {
    printf("Tab[%d}= %d\n", i, tab[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xed5(%rip),%eax
mov    %eax,-0x10(%rbp)
movl   $0x2,-0x28(%rbp)
movl   $0x1,-0x24(%rbp)
cmpl   $0x4,-0x24(%rbp)
jg     1181 <main+0x71>
mov    -0x24(%rbp),%eax
sub    $0x1,%eax
cltq
mov    -0x20(%rbp,%rax,4),%ecx
imul   -0x28(%rbp),%ecx
movslq -0x24(%rbp),%rax
mov    %ecx,-0x20(%rbp,%rax,4)
mov    -0x24(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x24(%rbp)
mov    %eax,-0x24(%rbp)
jmp    114c <main+0x3c>
movl   $0x4,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jl     11b7 <main+0xa7>
mov    -0x24(%rbp),%esi
movslq -0x24(%rbp),%rax
mov    -0x20(%rbp,%rax,4),%edx
lea    0xe70(%rip),%rdi
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1188 <main+0x78>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
@__const.main.tab = [5 x i32] [i32 2, i32 0, i32 0, i32 0, i32 0]
@.str = [13 x i8] c"Tab[%d}= %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i32]
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = bitcast [5 x i32]* %2 to i8*
store i32 2, i32* %4
store i32 1, i32* %3
br label %6
6: ; preds = %20, %0
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 4
br i1 %8, label %9, label %23
9: ; preds = %6
%10 = load i32, i32* %3
%11 = sub nsw i32 %10, 1
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 %12
%14 = load i32, i32* %13
%15 = load i32, i32* %4
%16 = mul nsw i32 %14, %15
%17 = load i32, i32* %3
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 %18
store i32 %16, i32* %19
br label %20
20: ; preds = %9
%21 = load i32, i32* %3
%22 = add nsw i32 %21, 1
store i32 %22, i32* %3
store i32 %21, i32* %3
br label %6
23: ; preds = %6
store i32 4, i32* %3
br label %24
24: ; preds = %34, %23
%25 = load i32, i32* %3
%26 = icmp sge i32 %25, 0
br i1 %26, label %27, label %37
27: ; preds = %24
%28 = load i32, i32* %3
%29 = load i32, i32* %3
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 %30
%32 = load i32, i32* %31
%33 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %28, i32 %32)
br label %34
34: ; preds = %27
%35 = load i32, i32* %3
%36 = sub nsw i32 %35, 1
store i32 %36, i32* %3
br label %24
37: ; preds = %24
ret i32 0
}

LLVM IR (-O2):