#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*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ gets();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
int strlen(char *);
int main(int argc, char **argv) {
  char set[] = "ABCDEFG";
  int count = 1;
  for (int i = 0; i < strlen(set); ++i)
    for (int j = i + 1; j < strlen(set); ++j)
      for (int k = j + 1; k < strlen(set); ++k)
        printf("%d:%C%C%C\n", count++, set[i], set[j], set[k]);
  printf("\n");
  fflush(stdout);
  fflush(stdin);
  gets();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xea3(%rip),%rax
mov    %rax,-0x18(%rbp)
movl   $0x1,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x2c(%rbp)
lea    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x2c(%rbp),%eax
cmp    %ecx,%eax
jge    123e <main+0xfe>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x30(%rbp)
lea    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x30(%rbp),%eax
cmp    %ecx,%eax
jge    122b <main+0xeb>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%eax
mov    %eax,-0x34(%rbp)
lea    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x34(%rbp),%eax
cmp    %ecx,%eax
jge    1218 <main+0xd8>
mov    -0x1c(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
movslq -0x20(%rbp),%rax
movsbl -0x18(%rbp,%rax,1),%edx
movslq -0x24(%rbp),%rax
movsbl -0x18(%rbp,%rax,1),%ecx
movslq -0x28(%rbp),%rax
movsbl -0x18(%rbp,%rax,1),%r8d
lea    0xe05(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    11b9 <main+0x79>
jmp    121d <main+0xdd>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1194 <main+0x54>
jmp    1230 <main+0xf0>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    116f <main+0x2f>
lea    0xdcc(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    0x2d85(%rip),%rax
mov    (%rax),%edi
call   1060 <fflush@plt>
mov    0x2d87(%rip),%rax
mov    (%rax),%edi
call   1060 <fflush@plt>
mov    $0x0,%al
call   1050 <gets@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
movabs $0x47464544434241,%rax
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rdi
call   1040 <strlen@plt>
test   %eax,%eax
jle    128e <main+0x13e>
mov    $0x1,%ebx
mov    $0x2,%r15d
mov    $0x1,%r14d
lea    0x8(%rsp),%r12
xor    %ebp,%ebp
jmp    11ca <main+0x7a>
nopl   0x0(%rax)
mov    %r12,%rdi
call   1040 <strlen@plt>
cltq
mov    0x28(%rsp),%r15
add    $0x1,%r15
mov    0x20(%rsp),%r14
add    $0x1,%r14
mov    0x18(%rsp),%rbp
cmp    %rax,%rbp
jge    128e <main+0x13e>
lea    0x1(%rbp),%r13
mov    %r12,%rdi
call   1040 <strlen@plt>
cltq
mov    %r14,0x20(%rsp)
mov    %r15,0x28(%rsp)
mov    %r15,0x10(%rsp)
mov    %r13,0x18(%rsp)
cmp    %rax,%r13
jl     1228 <main+0xd8>
jmp    11a0 <main+0x50>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %ebx,%r14d
mov    %r12,%r15
mov    %r15,%rdi
call   1040 <strlen@plt>
addq   $0x1,0x10(%rsp)
mov    %r14d,%ebx
mov    0x30(%rsp),%r14
cmp    %r14d,%eax
mov    %r15,%r12
jle    11a0 <main+0x50>
mov    %r14,%r13
add    $0x1,%r14
mov    %r12,%rdi
call   1040 <strlen@plt>
cmp    %r14d,%eax
mov    %r14,0x30(%rsp)
jle    1200 <main+0xb0>
mov    %r12,%r15
mov    0x10(%rsp),%r12
nopl   0x0(%rax)
lea    0x1(%rbx),%r14d
movsbl 0x8(%rsp,%rbp,1),%edx
movsbl 0x8(%rsp,%r13,1),%ecx
movsbl 0x8(%rsp,%r12,1),%r8d
lea    0xd94(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%r12
mov    %r15,%rdi
call   1040 <strlen@plt>
mov    %r14d,%ebx
cmp    %r12d,%eax
jg     1250 <main+0x100>
jmp    1206 <main+0xb6>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x2d39(%rip),%rax
mov    (%rax),%edi
call   1070 <fflush@plt>
mov    0x2d3b(%rip),%rax
mov    (%rax),%edi
call   1070 <fflush@plt>
xor    %eax,%eax
call   1060 <gets@plt>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@__const.main.set = [8 x i8] c"ABCDEFG\00"
@.str = [11 x i8] c"%d:%C%C%C\0A\00"
@.str.1 = [2 x i8] c"\0A\00"
@stdout = global i32 0
@stdin = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [8 x i8]
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%11 = bitcast [8 x i8]* %6 to i8*
store i32 1, i32* %7
store i32 0, i32* %8
br label %12
12: ; preds = %60, %2
%13 = load i32, i32* %8
%14 = getelementptr inbounds [8 x i8], [8 x i8]* %6, i64 0, i64 0
%15 = call i32 @strlen(i8* %14)
%16 = icmp slt i32 %13, %15
br i1 %16, label %17, label %63
17: ; preds = %12
%18 = load i32, i32* %8
%19 = add nsw i32 %18, 1
store i32 %19, i32* %9
br label %20
20: ; preds = %56, %17
%21 = load i32, i32* %9
%22 = getelementptr inbounds [8 x i8], [8 x i8]* %6, i64 0, i64 0
%23 = call i32 @strlen(i8* %22)
%24 = icmp slt i32 %21, %23
br i1 %24, label %25, label %59
25: ; preds = %20
%26 = load i32, i32* %9
%27 = add nsw i32 %26, 1
store i32 %27, i32* %10
br label %28
28: ; preds = %52, %25
%29 = load i32, i32* %10
%30 = getelementptr inbounds [8 x i8], [8 x i8]* %6, i64 0, i64 0
%31 = call i32 @strlen(i8* %30)
%32 = icmp slt i32 %29, %31
br i1 %32, label %33, label %55
33: ; preds = %28
%34 = load i32, i32* %7
%35 = add nsw i32 %34, 1
store i32 %35, i32* %7
%36 = load i32, i32* %8
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds [8 x i8], [8 x i8]* %6, i64 0, i64 %37
%39 = load i8, i8* %38
%40 = sext i8 %39 to i32
%41 = load i32, i32* %9
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds [8 x i8], [8 x i8]* %6, i64 0, i64 %42
%44 = load i8, i8* %43
%45 = sext i8 %44 to i32
%46 = load i32, i32* %10
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds [8 x i8], [8 x i8]* %6, i64 0, i64 %47
%49 = load i8, i8* %48
%50 = sext i8 %49 to i32
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %34, i32 %40, i32 %45, i32 %50)
br label %52
52: ; preds = %33
%53 = load i32, i32* %10
%54 = add nsw i32 %53, 1
store i32 %54, i32* %10
br label %28
55: ; preds = %28
br label %56
56: ; preds = %55
%57 = load i32, i32* %9
%58 = add nsw i32 %57, 1
store i32 %58, i32* %9
br label %20
59: ; preds = %20
br label %60
60: ; preds = %59
%61 = load i32, i32* %8
%62 = add nsw i32 %61, 1
store i32 %62, i32* %8
br label %12
63: ; preds = %12
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%65 = load i32, i32* @stdout
%66 = call i32 @fflush(i32 %65)
%67 = load i32, i32* @stdin
%68 = call i32 @fflush(i32 %67)
%69 = call i32 (...) @gets()
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"%d:%C%C%C\0A\00"
@stdout = global i32 0
@stdin = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i64
%4 = bitcast i64* %3 to [8 x i8]*
%5 = bitcast i64* %3 to i8*
store i64 20061986658402881, i64* %3
%6 = call i32 @strlen(i8* %5)
%7 = icmp sgt i32 %6, 0
br i1 %7, label %22, label %15
8: ; preds = %33, %22
%9 = phi i32 [ %26, %22 ], [ %34, %33 ]
%10 = call i32 @strlen(i8* %5)
%11 = sext i32 %10 to i64
%12 = icmp slt i64 %27, %11
%13 = add nuw nsw i64 %25, 1
%14 = add nuw nsw i64 %24, 1
br i1 %12, label %22, label %15
15: ; preds = %8, %2
%16 = call i32 @putchar(i32 10)
%17 = load i32, i32* @stdout
%18 = call i32 @fflush(i32 %17)
%19 = load i32, i32* @stdin
%20 = call i32 @fflush(i32 %19)
%21 = call i32 (...) @gets()
ret i32 0
22: ; preds = %2, %8
%23 = phi i64 [ %27, %8 ], [ 0, %2 ]
%24 = phi i64 [ %14, %8 ], [ 1, %2 ]
%25 = phi i64 [ %13, %8 ], [ 2, %2 ]
%26 = phi i32 [ %9, %8 ], [ 1, %2 ]
%27 = add nuw nsw i64 %23, 1
%28 = call i32 @strlen(i8* %5)
%29 = sext i32 %28 to i64
%30 = icmp slt i64 %27, %29
br i1 %30, label %31, label %8
31: ; preds = %22
%32 = getelementptr inbounds [8 x i8], [8 x i8]* %4, i64 0, i64 %23
br label %38
33: ; preds = %48, %38
%34 = phi i32 [ %41, %38 ], [ %51, %48 ]
%35 = call i32 @strlen(i8* %5)
%36 = icmp sgt i32 %35, %44
%37 = add nuw nsw i64 %40, 1
br i1 %36, label %38, label %8
38: ; preds = %31, %33
%39 = phi i64 [ %24, %31 ], [ %42, %33 ]
%40 = phi i64 [ %25, %31 ], [ %37, %33 ]
%41 = phi i32 [ %26, %31 ], [ %34, %33 ]
%42 = add nuw nsw i64 %39, 1
%43 = call i32 @strlen(i8* %5)
%44 = trunc i64 %42 to i32
%45 = icmp sgt i32 %43, %44
br i1 %45, label %46, label %33
46: ; preds = %38
%47 = getelementptr inbounds [8 x i8], [8 x i8]* %4, i64 0, i64 %39
br label %48
48: ; preds = %46, %48
%49 = phi i64 [ %40, %46 ], [ %60, %48 ]
%50 = phi i32 [ %41, %46 ], [ %51, %48 ]
%51 = add nsw i32 %50, 1
%52 = load i8, i8* %32
%53 = sext i8 %52 to i32
%54 = load i8, i8* %47
%55 = sext i8 %54 to i32
%56 = getelementptr inbounds [8 x i8], [8 x i8]* %4, i64 0, i64 %49
%57 = load i8, i8* %56
%58 = sext i8 %57 to i32
%59 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %50, i32 %53, i32 %55, i32 %58)
%60 = add nuw nsw i64 %49, 1
%61 = call i32 @strlen(i8* %5)
%62 = trunc i64 %60 to i32
%63 = icmp sgt i32 %61, %62
br i1 %63, label %48, label %33
}