#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 counter;
  for (counter = 0; counter < 3; ++counter) {
    int temporary = 1;
    static int permanent = 1;
    printf("Temporary %d Permanent %d\n", temporary, permanent);
    ++temporary;
    ++permanent;
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    1172 <main+0x62>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%esi
mov    0x2ee8(%rip),%edx
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    0x2ecd(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2ec4(%rip)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2f11(%rip),%edx
lea    0xee2(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
mov    0x2ef7(%rip),%edx
add    $0x1,%edx
mov    %edx,0x2eee(%rip)
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
mov    0x2edb(%rip),%edx
add    $0x1,%edx
mov    %edx,0x2ed2(%rip)
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
addl   $0x1,0x2ebe(%rip)
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@main.permanent = internal unnamed_addr global i32 1
@.str = [27 x i8] c"Temporary %d Permanent %d\0A\00"
define i32 @main() {
%1 = load i32, i32* @main.permanent
%2 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 1, i32 %1)
%3 = load i32, i32* @main.permanent
%4 = add nsw i32 %3, 1
store i32 %4, i32* @main.permanent
%5 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 1, i32 %4)
%6 = load i32, i32* @main.permanent
%7 = add nsw i32 %6, 1
store i32 %7, i32* @main.permanent
%8 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 1, i32 %7)
%9 = load i32, i32* @main.permanent
%10 = add nsw i32 %9, 1
store i32 %10, i32* @main.permanent
ret i32 0
}