#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 /*<<< orphan*/);
int main(int argc, char **argv) {
  int i, j;
  int x = 0;
  int r = 42;
  for (i = 0; i < 8; ++i) {
    for (j = 0; j < 8; ++j) {
      if ((r > 0) && (j > i))
        printf("%d,%d,%d\n", i, j, x++);
    }
  }
  return x;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x2a,-0x20(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x8,-0x14(%rbp)
jge    11af <main+0x9f>
movl   $0x0,-0x18(%rbp)
cmpl   $0x8,-0x18(%rbp)
jge    119c <main+0x8c>
cmpl   $0x0,-0x20(%rbp)
jle    1189 <main+0x79>
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jle    1189 <main+0x79>
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x1c(%rbp),%ecx
mov    %ecx,%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
lea    0xe7c(%rip),%rdi
call   1030 <printf@plt>
jmp    118e <main+0x7e>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    114c <main+0x3c>
jmp    11a1 <main+0x91>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    113b <main+0x2b>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xede(%rip),%r14
xor    %r15d,%r15d
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x1,%edx
xor    %ecx,%ecx
call   1030 <printf@plt>
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x2,%edx
mov    $0x1,%ecx
call   1030 <printf@plt>
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x3,%edx
mov    $0x2,%ecx
call   1030 <printf@plt>
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x4,%edx
mov    $0x3,%ecx
call   1030 <printf@plt>
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x5,%edx
mov    $0x4,%ecx
call   1030 <printf@plt>
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x6,%edx
mov    $0x5,%ecx
call   1030 <printf@plt>
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x7,%edx
mov    $0x6,%ecx
call   1030 <printf@plt>
mov    %r14,%rdi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x7,%ecx
call   1030 <printf@plt>
mov    %r14,%rdi
mov    $0x1,%esi
mov    $0x3,%edx
mov    $0x8,%ecx
call   1030 <printf@plt>
mov    %r14,%rdi
mov    $0x1,%esi
mov    $0x4,%edx
mov    $0x9,%ecx
call   1030 <printf@plt>
mov    %r14,%rdi
mov    $0x1,%esi
mov    $0x5,%edx
mov    $0xa,%ecx
call   1030 <printf@plt>
mov    %r14,%rdi
mov    $0x1,%esi
mov    $0x6,%edx
mov    $0xb,%ecx
call   1030 <printf@plt>
mov    $0xd,%ebx
mov    %r14,%rdi
mov    $0x1,%esi
mov    $0x7,%edx
mov    $0xc,%ecx
call   1030 <printf@plt>
nopl   (%rax)
lea    0x2(%r15),%r13d
test   %r15d,%r15d
je     1270 <main+0x160>
cmp    $0x3,%r13d
jbe    1289 <main+0x179>
cmp    $0x2,%r15d
je     12a2 <main+0x192>
cmp    $0x5,%r13d
jbe    12bb <main+0x1ab>
cmp    $0x4,%r15d
je     12d2 <main+0x1c2>
jmp    12e9 <main+0x1d9>
cs nopw 0x0(%rax,%rax,1)
lea    0x1(%rbx),%r12d
mov    %r14,%rdi
mov    %r13d,%esi
mov    $0x3,%edx
mov    %ebx,%ecx
call   1030 <printf@plt>
mov    %r12d,%ebx
lea    0x1(%rbx),%r12d
mov    %r14,%rdi
mov    %r13d,%esi
mov    $0x4,%edx
mov    %ebx,%ecx
call   1030 <printf@plt>
mov    %r12d,%ebx
lea    0x1(%rbx),%r12d
mov    %r14,%rdi
mov    %r13d,%esi
mov    $0x5,%edx
mov    %ebx,%ecx
call   1030 <printf@plt>
mov    %r12d,%ebx
lea    0x1(%rbx),%ebp
mov    %r14,%rdi
mov    %r13d,%esi
mov    $0x6,%edx
mov    %ebx,%ecx
call   1030 <printf@plt>
mov    %ebp,%ebx
lea    0x1(%rbx),%ebp
mov    %r14,%rdi
mov    %r13d,%esi
mov    $0x7,%edx
mov    %ebx,%ecx
call   1030 <printf@plt>
mov    %ebp,%ebx
add    $0x1,%r15d
cmp    $0x6,%r15d
jne    1240 <main+0x130>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"%d,%d,%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 0, i32 1, i32 0)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 0, i32 2, i32 1)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 0, i32 3, i32 2)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 0, i32 4, i32 3)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 0, i32 5, i32 4)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 0, i32 6, i32 5)
%9 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 0, i32 7, i32 6)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 1, i32 2, i32 7)
%11 = add nuw nsw i32 8, 1
%12 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 1, i32 3, i32 8)
%13 = add nsw i32 %11, 1
%14 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 1, i32 4, i32 %11)
%15 = add nsw i32 %13, 1
%16 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 1, i32 5, i32 %13)
%17 = add nsw i32 %15, 1
%18 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 1, i32 6, i32 %15)
%19 = add nsw i32 %17, 1
%20 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 1, i32 7, i32 %17)
br label %21
21: ; preds = %2, %52
%22 = phi i32 [ 2, %2 ], [ %54, %52 ]
%23 = phi i32 [ %19, %2 ], [ %53, %52 ]
%24 = icmp eq i32 %22, 2
br i1 %24, label %25, label %28
25: ; preds = %21
%26 = add nsw i32 %23, 1
%27 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %22, i32 3, i32 %23)
br label %30
28: ; preds = %21
%29 = icmp ult i32 %22, 4
br i1 %29, label %30, label %34
30: ; preds = %28, %25
%31 = phi i32 [ %26, %25 ], [ %23, %28 ]
%32 = add nsw i32 %31, 1
%33 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %22, i32 4, i32 %31)
br label %36
34: ; preds = %28
%35 = icmp eq i32 %22, 4
br i1 %35, label %36, label %40
36: ; preds = %34, %30
%37 = phi i32 [ %32, %30 ], [ %23, %34 ]
%38 = add nsw i32 %37, 1
%39 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %22, i32 5, i32 %37)
br label %42
40: ; preds = %34
%41 = icmp ult i32 %22, 6
br i1 %41, label %42, label %46
42: ; preds = %40, %36
%43 = phi i32 [ %38, %36 ], [ %23, %40 ]
%44 = add nsw i32 %43, 1
%45 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %22, i32 6, i32 %43)
br label %48
46: ; preds = %40
%47 = icmp eq i32 %22, 6
br i1 %47, label %48, label %52
48: ; preds = %42, %46
%49 = phi i32 [ %44, %42 ], [ %23, %46 ]
%50 = add nsw i32 %49, 1
%51 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %22, i32 7, i32 %49)
br label %52
52: ; preds = %48, %46
%53 = phi i32 [ %50, %48 ], [ %23, %46 ]
%54 = add nuw nsw i32 %22, 1
%55 = icmp eq i32 %54, 8
br i1 %55, label %56, label %21
56: ; preds = %52
ret i32 %53
}