#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 i, j, k;
  for (i = 1; i <= 4; i++)
    for (j = 1; j <= 4; j++)
      for (k = 1; k <= 4; k++) {
        if (i != j && i != k && j != k)
          printf("%d%d%d\n", i, j, k);
      }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x4,-0x8(%rbp)
jg     11c4 <main+0xb4>
movl   $0x1,-0xc(%rbp)
cmpl   $0x4,-0xc(%rbp)
jg     11b1 <main+0xa1>
movl   $0x1,-0x10(%rbp)
cmpl   $0x4,-0x10(%rbp)
jg     119e <main+0x8e>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
je     118b <main+0x7b>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
je     118b <main+0x7b>
mov    -0xc(%rbp),%eax
cmp    -0x10(%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,%r12d
xor    %r15d,%r15d
lea    0xed8(%rip),%r14
jmp    1142 <main+0x32>
nopw   0x0(%rax,%rax,1)
add    $0x1,%r12d
add    $0xffffffff,%r15d
cmp    $0x5,%r12d
je     11ed <main+0xdd>
mov    $0x1,%ebx
jmp    1158 <main+0x48>
nopl   0x0(%rax)
add    $0x1,%ebx
cmp    $0x5,%ebx
je     1130 <main+0x20>
lea    (%r15,%rbx,1),%ebp
cmp    $0x1,%ebp
je     117e <main+0x6e>
cmp    $0x1,%r12d
je     117e <main+0x6e>
cmp    $0x1,%ebx
je     117e <main+0x6e>
mov    %r14,%rdi
mov    %r12d,%esi
mov    %ebx,%edx
mov    $0x1,%ecx
call   1030 <printf@plt>
cmp    $0x1,%ebp
je     11a0 <main+0x90>
cmp    $0x2,%r12d
je     11a0 <main+0x90>
cmp    $0x2,%ebx
je     11a0 <main+0x90>
mov    %r14,%rdi
mov    %r12d,%esi
mov    %ebx,%edx
mov    $0x2,%ecx
call   1030 <printf@plt>
cmp    $0x1,%ebp
je     11c2 <main+0xb2>
cmp    $0x3,%r12d
je     11c2 <main+0xb2>
cmp    $0x3,%ebx
je     11c2 <main+0xb2>
mov    %r14,%rdi
mov    %r12d,%esi
mov    %ebx,%edx
mov    $0x3,%ecx
call   1030 <printf@plt>
cmp    $0x1,%ebp
je     1150 <main+0x40>
cmp    $0x4,%r12d
je     1150 <main+0x40>
cmp    $0x4,%ebx
je     1150 <main+0x40>
mov    %r14,%rdi
mov    %r12d,%esi
mov    %ebx,%edx
mov    $0x4,%ecx
call   1030 <printf@plt>
jmp    1150 <main+0x40>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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