#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);
void main() {
  int i, num;
  num = 2;
  for (i = 0; i < 3; i++) {
    printf("\40:The num equal %d\n", num);
    num++;
    {
      static int num = 1;
      printf("\40:The internal block num equal %d\n", num);
      num++;
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x2,-0x8(%rbp)
movl   $0x0,-0x4(%rbp)
cmpl   $0x3,-0x4(%rbp)
jge    1177 <main+0x67>
mov    -0x8(%rbp),%esi
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    0x2eda(%rip),%esi
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ec8(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2ebf(%rip)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1126 <main+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xee5(%rip),%r14
mov    %r14,%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
mov    0x2efa(%rip),%esi
lea    0xedf(%rip),%rbx
mov    %rbx,%rdi
call   1030 <printf@plt>
addl   $0x1,0x2ee4(%rip)
mov    %r14,%rdi
mov    $0x3,%esi
call   1030 <printf@plt>
mov    0x2ed1(%rip),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
addl   $0x1,0x2ec2(%rip)
mov    %r14,%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
mov    0x2eaf(%rip),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
addl   $0x1,0x2ea0(%rip)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [20 x i8] c" :The num equal %d\0A\00"
@main.num = internal global i32 1
@.str.1 = [35 x i8] c" :The internal block num equal %d\0A\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
store i32 2, i32* %2
store i32 0, i32* %1
br label %3
3: ; preds = %15, %0
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 3
br i1 %5, label %6, label %18
6: ; preds = %3
%7 = load i32, i32* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 1
store i32 %10, i32* %2
%11 = load i32, i32* @main.num
%12 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i32 %11)
%13 = load i32, i32* @main.num
%14 = add nsw i32 %13, 1
store i32 %14, i32* @main.num
br label %15
15: ; preds = %6
%16 = load i32, i32* %1
%17 = add nsw i32 %16, 1
store i32 %17, i32* %1
br label %3
18: ; preds = %3
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c" :The num equal %d\0A\00"
@main.num = internal unnamed_addr global i32 1
@.str.1 = [35 x i8] c" :The internal block num equal %d\0A\00"
define void @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 2)
%2 = load i32, i32* @main.num
%3 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i32 %2)
%4 = load i32, i32* @main.num
%5 = add nsw i32 %4, 1
store i32 %5, i32* @main.num
%6 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 3)
%7 = load i32, i32* @main.num
%8 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = load i32, i32* @main.num
%10 = add nsw i32 %9, 1
store i32 %10, i32* @main.num
%11 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 4)
%12 = load i32, i32* @main.num
%13 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i32 %12)
%14 = load i32, i32* @main.num
%15 = add nsw i32 %14, 1
store i32 %15, i32* @main.num
ret void
}