#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);
int main() {
  int a, b, c;
  for (a = 1; a <= 3; a++) {
    for (b = 1; b <= 3; b++) {
      if (b != a) {
        for (c = 1; c <= 3; c++) {
          if (c != b && c != a) {
            printf("%d %d %d\n", a, b, c);
          }
        }
      }
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x3,-0x8(%rbp)
jg     11c9 <main+0xb9>
movl   $0x1,-0xc(%rbp)
cmpl   $0x3,-0xc(%rbp)
jg     11b6 <main+0xa6>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
je     11a3 <main+0x93>
movl   $0x1,-0x10(%rbp)
cmpl   $0x3,-0x10(%rbp)
jg     119e <main+0x8e>
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
je     118b <main+0x7b>
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
je     118b <main+0x7b>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xe7a(%rip),%rdi
call   1030 <printf@plt>
jmp    1190 <main+0x80>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1154 <main+0x44>
jmp    11a3 <main+0x93>
jmp    11a8 <main+0x98>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1137 <main+0x27>
jmp    11bb <main+0xab>
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   %rbp
push   %r14
push   %rbx
mov    $0x1,%ebx
lea    0xee0(%rip),%r14
jmp    115d <main+0x4d>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0x2,%ebp
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
call   1030 <printf@plt>
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x3,%edx
mov    %ebp,%ecx
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x1,%ebx
je     1130 <main+0x20>
cmp    $0x2,%ebx
jne    1180 <main+0x70>
mov    $0x1,%ebp
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x1,%edx
jmp    113f <main+0x2f>
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x1,%edx
mov    $0x2,%ecx
call   1030 <printf@plt>
cmp    $0x3,%ebx
je     11ee <main+0xde>
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x1,%edx
mov    $0x3,%ecx
call   1030 <printf@plt>
mov    $0x2,%ebp
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x2,%edx
mov    $0x1,%ecx
call   1030 <printf@plt>
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
call   1030 <printf@plt>
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x3,%edx
mov    $0x1,%ecx
jmp    1144 <main+0x34>
lea    0xe0b(%rip),%rdi
mov    %ebx,%esi
mov    $0x2,%edx
mov    $0x1,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [10 x i8] c"%d %d %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
br label %5
5: ; preds = %43, %0
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 3
br i1 %7, label %8, label %46
8: ; preds = %5
store i32 1, i32* %3
br label %9
9: ; preds = %39, %8
%10 = load i32, i32* %3
%11 = icmp sle i32 %10, 3
br i1 %11, label %12, label %42
12: ; preds = %9
%13 = load i32, i32* %3
%14 = load i32, i32* %2
%15 = icmp ne i32 %13, %14
br i1 %15, label %16, label %38
16: ; preds = %12
store i32 1, i32* %4
br label %17
17: ; preds = %34, %16
%18 = load i32, i32* %4
%19 = icmp sle i32 %18, 3
br i1 %19, label %20, label %37
20: ; preds = %17
%21 = load i32, i32* %4
%22 = load i32, i32* %3
%23 = icmp ne i32 %21, %22
br i1 %23, label %24, label %33
24: ; preds = %20
%25 = load i32, i32* %4
%26 = load i32, i32* %2
%27 = icmp ne i32 %25, %26
br i1 %27, label %28, label %33
28: ; preds = %24
%29 = load i32, i32* %2
%30 = load i32, i32* %3
%31 = load i32, i32* %4
%32 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %29, i32 %30, i32 %31)
br label %33
33: ; preds = %28, %24, %20
br label %34
34: ; preds = %33
%35 = load i32, i32* %4
%36 = add nsw i32 %35, 1
store i32 %36, i32* %4
br label %17
37: ; preds = %17
br label %38
38: ; preds = %37, %12
br label %39
39: ; preds = %38
%40 = load i32, i32* %3
%41 = add nsw i32 %40, 1
store i32 %41, i32* %3
br label %9
42: ; preds = %9
br label %43
43: ; preds = %42
%44 = load i32, i32* %2
%45 = add nsw i32 %44, 1
store i32 %45, i32* %2
br label %5
46: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"%d %d %d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %15, %0
%2 = phi i32 [ 1, %0 ], [ %18, %15 ]
switch i32 %2, label %5 [
i32 1, label %13
i32 2, label %3
]
3: ; preds = %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %2, i32 1, i32 3)
br label %15
5: ; preds = %1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %2, i32 1, i32 2)
%7 = icmp eq i32 %2, 3
br i1 %7, label %19, label %8
8: ; preds = %5
%9 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %2, i32 1, i32 3)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %2, i32 2, i32 1)
%11 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %2, i32 2, i32 3)
%12 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %2, i32 3, i32 1)
br label %15
13: ; preds = %1
%14 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %2, i32 2, i32 3)
br label %15
15: ; preds = %13, %8, %3
%16 = phi i32 [ 1, %3 ], [ 2, %8 ], [ 2, %13 ]
%17 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %2, i32 3, i32 %16)
%18 = add nuw nsw i32 %2, 1
br label %1
19: ; preds = %5
%20 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %2, i32 2, i32 1)
ret i32 0
}