#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 invert(unsigned int, int, int);
int /*<<< orphan*/ printf(char *, unsigned int, int, int, int);
int main(void) {
  unsigned x;
  int p, n;
  for (x = 0; x < 700; x += 49)
    for (n = 1; n < 8; n++)
      for (p = 1; p < 8; p++)
        printf("%u, %d, %d: %u\n", x, n, p, invert(x, n, p));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x2bc,-0x8(%rbp)
jae    11d1 <main+0xb1>
movl   $0x1,-0x10(%rbp)
cmpl   $0x8,-0x10(%rbp)
jge    11be <main+0x9e>
movl   $0x1,-0xc(%rbp)
cmpl   $0x8,-0xc(%rbp)
jge    11ab <main+0x8b>
mov    -0x8(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <invert@plt>
mov    -0x1c(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    %eax,%r8d
lea    0xe68(%rip),%rdi
call   1040 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    115b <main+0x3b>
jmp    11b0 <main+0x90>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    114a <main+0x2a>
jmp    11c3 <main+0xa3>
mov    -0x8(%rbp),%eax
add    $0x31,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
xor    %ebx,%ebx
lea    0xed3(%rip),%r14
nopl   (%rax)
mov    $0x1,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ebx,%edi
mov    %ebp,%esi
mov    $0x1,%edx
call   1030 <invert@plt>
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebp,%edx
mov    $0x1,%ecx
mov    %eax,%r8d
call   1040 <printf@plt>
mov    %ebx,%edi
mov    %ebp,%esi
mov    $0x2,%edx
call   1030 <invert@plt>
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebp,%edx
mov    $0x2,%ecx
mov    %eax,%r8d
call   1040 <printf@plt>
mov    %ebx,%edi
mov    %ebp,%esi
mov    $0x3,%edx
call   1030 <invert@plt>
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebp,%edx
mov    $0x3,%ecx
mov    %eax,%r8d
call   1040 <printf@plt>
mov    %ebx,%edi
mov    %ebp,%esi
mov    $0x4,%edx
call   1030 <invert@plt>
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebp,%edx
mov    $0x4,%ecx
mov    %eax,%r8d
call   1040 <printf@plt>
mov    %ebx,%edi
mov    %ebp,%esi
mov    $0x5,%edx
call   1030 <invert@plt>
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebp,%edx
mov    $0x5,%ecx
mov    %eax,%r8d
call   1040 <printf@plt>
mov    %ebx,%edi
mov    %ebp,%esi
mov    $0x6,%edx
call   1030 <invert@plt>
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebp,%edx
mov    $0x6,%ecx
mov    %eax,%r8d
call   1040 <printf@plt>
mov    %ebx,%edi
mov    %ebp,%esi
mov    $0x7,%edx
call   1030 <invert@plt>
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebp,%edx
mov    $0x7,%ecx
mov    %eax,%r8d
call   1040 <printf@plt>
add    $0x1,%ebp
cmp    $0x8,%ebp
jne    1140 <main+0x20>
lea    0x31(%rbx),%eax
cmp    $0x28b,%ebx
mov    %eax,%ebx
jb     1130 <main+0x10>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

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