#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 */
typedef int /*<<< orphan*/ tmp;

/* Variables and functions */
int /*<<< orphan*/ compare(char **, char **, int);
int /*<<< orphan*/ memcpy(char **, char **, int);
int /*<<< orphan*/ memset(char **, int /*<<< orphan*/, int);
int /*<<< orphan*/ reflection(char **, char **, int);
int /*<<< orphan*/ rotate_90(char **, char **, int);
int combination(char before[][10], char trans[][10], char target[][10], int n) {
  char tmp[10][10];
  memset(tmp, 0, sizeof(tmp));
  reflection(before, trans, n);
  int i;
  for (i = 0; i < 3; ++i) {
    rotate_90(trans, tmp, n);
    if (!compare(tmp, target, n))
      return 0;
    memcpy(trans, tmp, sizeof(tmp));
  }
  return 1;
}


x86 assembly (clang, -O0):
<combination>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
lea    -0x90(%rbp),%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   1040 <memset@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x24(%rbp),%edx
call   1060 <reflection@plt>
movl   $0x0,-0x94(%rbp)
cmpl   $0x3,-0x94(%rbp)
jge    1208 <combination+0xb8>
mov    -0x18(%rbp),%rdi
lea    -0x90(%rbp),%rsi
mov    -0x24(%rbp),%edx
call   1030 <rotate_90@plt>
lea    -0x90(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x24(%rbp),%edx
call   1070 <compare@plt>
cmp    $0x0,%eax
jne    11df <combination+0x8f>
movl   $0x0,-0x4(%rbp)
jmp    120f <combination+0xbf>
mov    -0x18(%rbp),%rdi
lea    -0x90(%rbp),%rsi
mov    $0x64,%edx
call   1050 <memcpy@plt>
mov    -0x94(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x94(%rbp)
jmp    1197 <combination+0x47>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<combination>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
mov    %ecx,%ebp
mov    %rdx,%r15
mov    %rsi,%r12
mov    %rdi,%rbx
mov    %rsp,%r13
xor    %r14d,%r14d
mov    %r13,%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   1040 <memset@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
mov    %ebp,%edx
call   1060 <reflection@plt>
mov    %r12,%rdi
mov    %r13,%rsi
mov    %ebp,%edx
call   1030 <rotate_90@plt>
mov    %r13,%rdi
mov    %r15,%rsi
mov    %ebp,%edx
call   1070 <compare@plt>
test   %eax,%eax
je     1221 <combination+0xd1>
mov    %rsp,%rbx
mov    %r12,%rdi
mov    %rbx,%rsi
mov    $0x64,%edx
call   1050 <memcpy@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
call   1030 <rotate_90@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %ebp,%edx
call   1070 <compare@plt>
test   %eax,%eax
je     1221 <combination+0xd1>
mov    %rsp,%rbx
mov    %r12,%rdi
mov    %rbx,%rsi
mov    $0x64,%edx
call   1050 <memcpy@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
call   1030 <rotate_90@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %ebp,%edx
call   1070 <compare@plt>
test   %eax,%eax
je     1221 <combination+0xd1>
mov    %rsp,%rsi
mov    %r12,%rdi
mov    $0x64,%edx
call   1050 <memcpy@plt>
mov    $0x1,%r14d
mov    %r14d,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @combination([10 x i8]* %0, [10 x i8]* %1, [10 x i8]* %2, i32 %3) {
%5 = alloca i32
%6 = alloca [10 x i8]*
%7 = alloca [10 x i8]*
%8 = alloca [10 x i8]*
%9 = alloca i32
%10 = alloca [10 x [10 x i8]]
%11 = alloca i32
store [10 x i8]* %0, [10 x i8]** %6
store [10 x i8]* %1, [10 x i8]** %7
store [10 x i8]* %2, [10 x i8]** %8
store i32 %3, i32* %9
%12 = getelementptr inbounds [10 x [10 x i8]], [10 x [10 x i8]]* %10, i64 0, i64 0
%13 = bitcast [10 x i8]* %12 to i8**
%14 = call i32 @memset(i8** %13, i32 0, i32 100)
%15 = load [10 x i8]*, [10 x i8]** %6
%16 = bitcast [10 x i8]* %15 to i8**
%17 = load [10 x i8]*, [10 x i8]** %7
%18 = bitcast [10 x i8]* %17 to i8**
%19 = load i32, i32* %9
%20 = call i32 @reflection(i8** %16, i8** %18, i32 %19)
store i32 0, i32* %11
br label %21
21: ; preds = %45, %4
%22 = load i32, i32* %11
%23 = icmp slt i32 %22, 3
br i1 %23, label %24, label %48
24: ; preds = %21
%25 = load [10 x i8]*, [10 x i8]** %7
%26 = bitcast [10 x i8]* %25 to i8**
%27 = getelementptr inbounds [10 x [10 x i8]], [10 x [10 x i8]]* %10, i64 0, i64 0
%28 = bitcast [10 x i8]* %27 to i8**
%29 = load i32, i32* %9
%30 = call i32 @rotate_90(i8** %26, i8** %28, i32 %29)
%31 = getelementptr inbounds [10 x [10 x i8]], [10 x [10 x i8]]* %10, i64 0, i64 0
%32 = bitcast [10 x i8]* %31 to i8**
%33 = load [10 x i8]*, [10 x i8]** %8
%34 = bitcast [10 x i8]* %33 to i8**
%35 = load i32, i32* %9
%36 = call i32 @compare(i8** %32, i8** %34, i32 %35)
%37 = icmp ne i32 %36, 0
br i1 %37, label %39, label %38
38: ; preds = %24
store i32 0, i32* %5
br label %49
39: ; preds = %24
%40 = load [10 x i8]*, [10 x i8]** %7
%41 = bitcast [10 x i8]* %40 to i8**
%42 = getelementptr inbounds [10 x [10 x i8]], [10 x [10 x i8]]* %10, i64 0, i64 0
%43 = bitcast [10 x i8]* %42 to i8**
%44 = call i32 @memcpy(i8** %41, i8** %43, i32 100)
br label %45
45: ; preds = %39
%46 = load i32, i32* %11
%47 = add nsw i32 %46, 1
store i32 %47, i32* %11
br label %21
48: ; preds = %21
store i32 1, i32* %5
br label %49
49: ; preds = %48, %38
%50 = load i32, i32* %5
ret i32 %50
}

LLVM IR (-O2):
define i32 @combination([10 x i8]* %0, [10 x i8]* %1, [10 x i8]* %2, i32 %3) {
%5 = alloca [10 x [10 x i8]]
%6 = getelementptr inbounds [10 x [10 x i8]], [10 x [10 x i8]]* %5, i64 0, i64 0, i64 0
%7 = bitcast [10 x [10 x i8]]* %5 to i8**
%8 = call i32 @memset(i8** %7, i32 0, i32 100)
%9 = bitcast [10 x i8]* %0 to i8**
%10 = bitcast [10 x i8]* %1 to i8**
%11 = call i32 @reflection(i8** %9, i8** %10, i32 %3)
%12 = bitcast [10 x i8]* %2 to i8**
%13 = call i32 @rotate_90(i8** %10, i8** %7, i32 %3)
%14 = call i32 @compare(i8** %7, i8** %12, i32 %3)
%15 = icmp eq i32 %14, 0
br i1 %15, label %28, label %16
16: ; preds = %4
%17 = call i32 @memcpy(i8** %10, i8** %7, i32 100)
%18 = call i32 @rotate_90(i8** %10, i8** %7, i32 %3)
%19 = call i32 @compare(i8** %7, i8** %12, i32 %3)
%20 = icmp eq i32 %19, 0
br i1 %20, label %28, label %21
21: ; preds = %16
%22 = call i32 @memcpy(i8** %10, i8** %7, i32 100)
%23 = call i32 @rotate_90(i8** %10, i8** %7, i32 %3)
%24 = call i32 @compare(i8** %7, i8** %12, i32 %3)
%25 = icmp eq i32 %24, 0
br i1 %25, label %28, label %26
26: ; preds = %21
%27 = call i32 @memcpy(i8** %10, i8** %7, i32 100)
br label %28
28: ; preds = %26, %21, %16, %4
%29 = phi i32 [ 0, %4 ], [ 0, %16 ], [ 0, %21 ], [ 1, %26 ]
ret i32 %29
}