#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 *, ...);
void main() {
  int i[7], j;
  for (i[0] = 1; i[0] <= 29; i[0]++)
    for (i[1] = 1; i[1] <= 29; i[1]++) {
      if (i[0] == i[1])
        continue;
      for (i[2] = 1; i[2] <= 29; i[2]++) {
        if (i[2] == i[0] || i[2] == i[1])
          continue;
        for (j = 0; j < 3; j++)
          printf("%4d", i[j]);
        printf("\n");
      }
    }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x1,-0x20(%rbp)
cmpl   $0x1d,-0x20(%rbp)
jg     11f0 <main+0xe0>
movl   $0x1,-0x1c(%rbp)
cmpl   $0x1d,-0x1c(%rbp)
jg     11dd <main+0xcd>
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jne    114b <main+0x3b>
jmp    11cf <main+0xbf>
movl   $0x1,-0x18(%rbp)
cmpl   $0x1d,-0x18(%rbp)
jg     11ca <main+0xba>
mov    -0x18(%rbp),%eax
cmp    -0x20(%rbp),%eax
je     1174 <main+0x64>
mov    -0x18(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jne    1179 <main+0x69>
jmp    11bc <main+0xac>
movl   $0x0,-0x24(%rbp)
cmpl   $0x3,-0x24(%rbp)
jge    11ae <main+0x9e>
movslq -0x24(%rbp),%rax
mov    -0x20(%rbp,%rax,4),%esi
lea    0xe67(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1180 <main+0x70>
lea    0xe4f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1152 <main+0x42>
jmp    11cf <main+0xbf>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1130 <main+0x20>
jmp    11e2 <main+0xd2>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    111f <main+0xf>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    $0x1,%r14d
lea    0xec8(%rip),%r15
xor    %r12d,%r12d
jmp    114e <main+0x2e>
nopl   (%rax)
add    $0x1,%r14d
add    $0xffffffff,%r12d
cmp    $0x1e,%r14d
je     11cb <main+0xab>
xor    %ebp,%ebp
mov    $0x1,%r13d
jmp    116d <main+0x4d>
nopl   0x0(%rax,%rax,1)
add    $0x1,%r13d
add    $0xffffffff,%ebp
cmp    $0x1e,%r13d
je     1140 <main+0x20>
cmp    %r13d,%r14d
je     1160 <main+0x40>
mov    $0x1,%ebx
jmp    1188 <main+0x68>
nopl   0x0(%rax)
add    $0x1,%ebx
cmp    $0x1e,%ebx
je     1160 <main+0x40>
lea    (%r12,%rbx,1),%eax
cmp    $0x1,%eax
je     1180 <main+0x60>
lea    (%rbx,%rbp,1),%eax
cmp    $0x1,%eax
je     1180 <main+0x60>
mov    %r15,%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %r13d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    1180 <main+0x60>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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