#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++) {
      for (c = 1; c <= 3; c++) {
        if (b != a && c != a && c != b) {
          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     11c4 <main+0xb4>
movl   $0x1,-0xc(%rbp)
cmpl   $0x3,-0xc(%rbp)
jg     11b1 <main+0xa1>
movl   $0x1,-0x10(%rbp)
cmpl   $0x3,-0x10(%rbp)
jg     119e <main+0x8e>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
je     118b <main+0x7b>
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
je     118b <main+0x7b>
mov    -0x10(%rbp),%eax
cmp    -0xc(%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    1148 <main+0x38>
jmp    11a3 <main+0x93>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1137 <main+0x27>
jmp    11b6 <main+0xa6>
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   %r15
push   %r14
push   %r12
push   %rbx
mov    $0x1,%ebx
lea    0xedc(%rip),%r14
jmp    113c <main+0x2c>
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%ebx
cmp    $0x4,%ebx
je     1210 <main+0x100>
lea    -0x1(%rbx),%r15d
cmp    $0x2,%r15d
jb     115a <main+0x4a>
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x1,%edx
mov    $0x2,%ecx
call   1030 <printf@plt>
mov    %ebx,%r12d
and    $0x7ffffffd,%r12d
cmp    $0x1,%r12d
je     117e <main+0x6e>
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x1,%edx
mov    $0x3,%ecx
call   1030 <printf@plt>
cmp    $0x2,%r15d
jb     1198 <main+0x88>
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x2,%edx
mov    $0x1,%ecx
call   1030 <printf@plt>
mov    %ebx,%ebp
and    $0x7ffffffe,%ebp
cmp    $0x2,%ebp
jne    11c0 <main+0xb0>
cmp    $0x1,%r12d
jne    11da <main+0xca>
cmp    $0x2,%ebp
je     1130 <main+0x20>
jmp    11f7 <main+0xe7>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
call   1030 <printf@plt>
cmp    $0x1,%r12d
je     11ab <main+0x9b>
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x3,%edx
mov    $0x1,%ecx
call   1030 <printf@plt>
cmp    $0x2,%ebp
je     1130 <main+0x20>
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x3,%edx
mov    $0x2,%ecx
call   1030 <printf@plt>
jmp    1130 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
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 = %42, %0
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 3
br i1 %7, label %8, label %45
8: ; preds = %5
store i32 1, i32* %3
br label %9
9: ; preds = %38, %8
%10 = load i32, i32* %3
%11 = icmp sle i32 %10, 3
br i1 %11, label %12, label %41
12: ; preds = %9
store i32 1, i32* %4
br label %13
13: ; preds = %34, %12
%14 = load i32, i32* %4
%15 = icmp sle i32 %14, 3
br i1 %15, label %16, label %37
16: ; preds = %13
%17 = load i32, i32* %3
%18 = load i32, i32* %2
%19 = icmp ne i32 %17, %18
br i1 %19, label %20, label %33
20: ; preds = %16
%21 = load i32, i32* %4
%22 = load i32, i32* %2
%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* %3
%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, %16
br label %34
34: ; preds = %33
%35 = load i32, i32* %4
%36 = add nsw i32 %35, 1
store i32 %36, i32* %4
br label %13
37: ; preds = %13
br label %38
38: ; preds = %37
%39 = load i32, i32* %3
%40 = add nsw i32 %39, 1
store i32 %40, i32* %3
br label %9
41: ; preds = %9
br label %42
42: ; preds = %41
%43 = load i32, i32* %2
%44 = add nsw i32 %43, 1
store i32 %44, i32* %2
br label %5
45: ; 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 = %32, %0
%2 = phi i32 [ 1, %0 ], [ %33, %32 ]
%3 = add nsw i32 %2, -1
%4 = icmp ult i32 %3, 2
br i1 %4, label %7, label %5
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)
br label %7
7: ; preds = %5, %1
%8 = and i32 %2, 2147483645
%9 = icmp eq i32 %8, 1
br i1 %9, label %12, label %10
10: ; preds = %7
%11 = 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 %12
12: ; preds = %10, %7
%13 = add nsw i32 %2, -1
%14 = icmp ult i32 %13, 2
br i1 %14, label %17, label %15
15: ; preds = %12
%16 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %2, i32 2, i32 1)
br label %17
17: ; preds = %12, %15
%18 = and i32 %2, 2147483646
%19 = icmp eq i32 %18, 2
br i1 %19, label %22, label %20
20: ; preds = %17
%21 = 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 %22
22: ; preds = %20, %17
%23 = and i32 %2, 2147483645
%24 = icmp eq i32 %23, 1
br i1 %24, label %27, label %25
25: ; preds = %22
%26 = 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 %27
27: ; preds = %25, %22
%28 = and i32 %2, 2147483646
%29 = icmp eq i32 %28, 2
br i1 %29, label %32, label %30
30: ; preds = %27
%31 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %2, i32 3, i32 2)
br label %32
32: ; preds = %27, %30
%33 = add nuw nsw i32 %2, 1
%34 = icmp eq i32 %33, 4
br i1 %34, label %35, label %1
35: ; preds = %32
ret i32 0
}