#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 /*<<< orphan*/ sleep(int);
int main(void) {
  int counter = 0;
  int i = 0;
  char *Lines[] = {"x", "tt", "Test", NULL};
  char *line;
  printf("%10s %4s\n", "STRING", "LEN");
  while (1) {
    if ((0))
      ;
    while (NULL != Lines[counter]) {
      line = Lines[counter];
      printf("%10s: ", line);
      for (i = 0; '\0' != *line; ++i) {
        ++line;
      }
      printf("%02d\n", i);
      ++counter;
    }
    counter = 0;
    sleep(1);
    if ((0))
      ;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    0x2cbc(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0x2cb9(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0x2cb6(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0x2cb3(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    0xe9a(%rip),%rdi
lea    0xe9d(%rip),%rsi
lea    0xe9d(%rip),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
jmp    118a <main+0x6a>
movslq -0x8(%rbp),%rcx
xor    %eax,%eax
cmp    -0x30(%rbp,%rcx,8),%rax
je     120b <main+0xeb>
movslq -0x8(%rbp),%rax
mov    -0x30(%rbp,%rax,8),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rsi
lea    0xe6c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0xc(%rbp)
mov    -0x38(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    %ecx,%eax
je     11ec <main+0xcc>
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11c1 <main+0xa1>
mov    -0xc(%rbp),%esi
lea    0xe30(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    118a <main+0x6a>
movl   $0x0,-0x8(%rbp)
mov    $0x1,%edi
call   1040 <sleep@plt>
jmp    1185 <main+0x65>

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
lea    0xeda(%rip),%rdi
lea    0xedd(%rip),%rsi
lea    0xedd(%rip),%rdx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed3(%rip),%r15
lea    0xead(%rip),%r14
lea    0xecc(%rip),%rbx
lea    0xea1(%rip),%r12
lea    0xe9d(%rip),%r13
nopl   0x0(%rax,%rax,1)
mov    %r15,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
jmp    1170 <main+0x50>

LLVM IR (-O0):
@.str = [2 x i8] c"x\00"
@.str.1 = [3 x i8] c"tt\00"
@.str.2 = [5 x i8] c"Test\00"
@__const.main.Lines = [4 x i8*] [i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i32 0, i32 0), i8* null]
@.str.3 = [10 x i8] c"%10s %4s\0A\00"
@.str.4 = [7 x i8] c"STRING\00"
@.str.5 = [4 x i8] c"LEN\00"
@.str.6 = [7 x i8] c"%10s: \00"
@.str.7 = [6 x i8] c"%02d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [4 x i8*]
%5 = alloca i8*
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
%6 = bitcast [4 x i8*]* %4 to i8*
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
br label %8
8: ; preds = %0, %38
br label %9
9: ; preds = %33, %8
%10 = load i32, i32* %2
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [4 x i8*], [4 x i8*]* %4, i64 0, i64 %11
%13 = load i8*, i8** %12
%14 = icmp ne i8* null, %13
br i1 %14, label %15, label %38
15: ; preds = %9
%16 = load i32, i32* %2
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [4 x i8*], [4 x i8*]* %4, i64 0, i64 %17
%19 = load i8*, i8** %18
store i8* %19, i8** %5
%20 = load i8*, i8** %5
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), i8* %20)
store i32 0, i32* %3
br label %22
22: ; preds = %30, %15
%23 = load i8*, i8** %5
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = icmp ne i32 0, %25
br i1 %26, label %27, label %33
27: ; preds = %22
%28 = load i8*, i8** %5
%29 = getelementptr inbounds i8, i8* %28, i32 1
store i8* %29, i8** %5
br label %30
30: ; preds = %27
%31 = load i32, i32* %3
%32 = add nsw i32 %31, 1
store i32 %32, i32* %3
br label %22
33: ; preds = %22
%34 = load i32, i32* %3
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), i32 %34)
%36 = load i32, i32* %2
%37 = add nsw i32 %36, 1
store i32 %37, i32* %2
br label %9
38: ; preds = %9
store i32 0, i32* %2
%39 = call i32 @sleep(i32 1)
br label %8
}

LLVM IR (-O2):
@.str = [2 x i8] c"x\00"
@.str.1 = [3 x i8] c"tt\00"
@.str.2 = [5 x i8] c"Test\00"
@.str.3 = [10 x i8] c"%10s %4s\0A\00"
@.str.4 = [7 x i8] c"STRING\00"
@.str.5 = [4 x i8] c"LEN\00"
@.str.6 = [7 x i8] c"%10s: \00"
@.str.7 = [6 x i8] c"%02d\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
br label %2
2: ; preds = %2, %0
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), i32 1)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), i32 2)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), i32 4)
%9 = tail call i32 @sleep(i32 1)
br label %2
}