#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 printf(char *, char, char, char);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char a[11];
  for (*a = 0; *a < 10 || 0 * printf("%c %c %c", a[1], a[4], a[7]);
       scanf(" %c", ++*a + a))
    ;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x0,-0xf(%rbp)
movsbl -0xf(%rbp),%ecx
mov    $0x1,%al
cmp    $0xa,%ecx
mov    %al,-0x10(%rbp)
jl     116d <main+0x4d>
mov    -0xe(%rbp),%cl
mov    -0xb(%rbp),%al
lea    0xeae(%rip),%rdi
movsbl %cl,%esi
movsbl %al,%edx
movsbl -0x8(%rbp),%ecx
call   1030 <printf@plt>
imul   $0x0,%eax,%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x10(%rbp)
mov    -0x10(%rbp),%al
test   $0x1,%al
jne    117d <main+0x5d>
jmp    11a7 <main+0x87>
jmp    1182 <main+0x62>
mov    -0xf(%rbp),%al
add    $0x1,%al
mov    %al,-0xf(%rbp)
movsbl %al,%eax
lea    -0xf(%rbp),%rsi
cltq
add    %rax,%rsi
lea    0xe68(%rip),%rdi
call   1040 <scanf@plt>
jmp    1133 <main+0x13>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
xor    %eax,%eax
lea    0xd(%rsp),%r14
lea    0xed0(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nop
lea    0x1(%rax),%ecx
mov    %cl,0xd(%rsp)
movsbq %al,%rax
lea    (%rax,%r14,1),%rsi
add    $0x1,%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
movzbl 0xd(%rsp),%eax
cmp    $0xa,%al
jl     1140 <main+0x20>
movsbl 0xe(%rsp),%esi
movsbl 0x11(%rsp),%edx
movsbl 0x14(%rsp),%ecx
lea    0xe86(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%c %c %c\00"
@.str.1 = [4 x i8] c" %c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [11 x i8]
store i32 0, i32* %1
%3 = getelementptr inbounds [11 x i8], [11 x i8]* %2, i64 0, i64 0
store i8 0, i8* %3
br label %4
4: ; preds = %22, %0
%5 = getelementptr inbounds [11 x i8], [11 x i8]* %2, i64 0, i64 0
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp slt i32 %7, 10
br i1 %8, label %19, label %9
9: ; preds = %4
%10 = getelementptr inbounds [11 x i8], [11 x i8]* %2, i64 0, i64 1
%11 = load i8, i8* %10
%12 = getelementptr inbounds [11 x i8], [11 x i8]* %2, i64 0, i64 4
%13 = load i8, i8* %12
%14 = getelementptr inbounds [11 x i8], [11 x i8]* %2, i64 0, i64 7
%15 = load i8, i8* %14
%16 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8 signext %11, i8 signext %13, i8 signext %15)
%17 = mul nsw i32 0, %16
%18 = icmp ne i32 %17, 0
br label %19
19: ; preds = %9, %4
%20 = phi i1 [ true, %4 ], [ %18, %9 ]
br i1 %20, label %21, label %31
21: ; preds = %19
br label %22
22: ; preds = %21
%23 = getelementptr inbounds [11 x i8], [11 x i8]* %2, i64 0, i64 0
%24 = load i8, i8* %23
%25 = add i8 %24, 1
store i8 %25, i8* %23
%26 = sext i8 %25 to i32
%27 = getelementptr inbounds [11 x i8], [11 x i8]* %2, i64 0, i64 0
%28 = sext i32 %26 to i64
%29 = getelementptr inbounds i8, i8* %27, i64 %28
%30 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %29)
br label %4
31: ; preds = %19
%32 = load i32, i32* %1
ret i32 %32
}

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