#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*/ copy_map(int **, int **, int);
int **game_initial(int);
int /*<<< orphan*/ game_over(int **, int);
int is_equal_map(int **, int **, int);
int /*<<< orphan*/ slide_map(int **, int, char);
int is_over(int **map, int length) {
  int **tmp;
  int ok;
  tmp = game_initial(length);
  copy_map(tmp, map, length);
  slide_map(tmp, length, 'u');
  slide_map(tmp, length, 'l');
  ok = is_equal_map(tmp, map, length);
  game_over(tmp, length);
  return ok;
}


x86 assembly (clang, -O0):
<is_over>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1060 <game_initial@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1040 <copy_map@plt>
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x75,%edx
call   1030 <slide_map@plt>
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x6c,%edx
call   1030 <slide_map@plt>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1050 <is_equal_map@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1070 <game_over@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_over>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
mov    %esi,%edi
call   1060 <game_initial@plt>
mov    %rax,%r15
mov    %rax,%rdi
mov    %r14,%rsi
mov    %ebx,%edx
call   1040 <copy_map@plt>
mov    %r15,%rdi
mov    %ebx,%esi
mov    $0x75,%edx
call   1030 <slide_map@plt>
mov    %r15,%rdi
mov    %ebx,%esi
mov    $0x6c,%edx
call   1030 <slide_map@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %ebx,%edx
call   1050 <is_equal_map@plt>
mov    %eax,%ebp
mov    %r15,%rdi
mov    %ebx,%esi
call   1070 <game_over@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @is_over(i32** %0, i32 %1) {
%3 = alloca i32**
%4 = alloca i32
%5 = alloca i32**
%6 = alloca i32
store i32** %0, i32*** %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = call i32** @game_initial(i32 %7)
store i32** %8, i32*** %5
%9 = load i32**, i32*** %5
%10 = load i32**, i32*** %3
%11 = load i32, i32* %4
%12 = call i32 @copy_map(i32** %9, i32** %10, i32 %11)
%13 = load i32**, i32*** %5
%14 = load i32, i32* %4
%15 = call i32 @slide_map(i32** %13, i32 %14, i8 signext 117)
%16 = load i32**, i32*** %5
%17 = load i32, i32* %4
%18 = call i32 @slide_map(i32** %16, i32 %17, i8 signext 108)
%19 = load i32**, i32*** %5
%20 = load i32**, i32*** %3
%21 = load i32, i32* %4
%22 = call i32 @is_equal_map(i32** %19, i32** %20, i32 %21)
store i32 %22, i32* %6
%23 = load i32**, i32*** %5
%24 = load i32, i32* %4
%25 = call i32 @game_over(i32** %23, i32 %24)
%26 = load i32, i32* %6
ret i32 %26
}

LLVM IR (-O2):
define i32 @is_over(i32** %0, i32 %1) {
%3 = tail call i32** @game_initial(i32 %1)
%4 = tail call i32 @copy_map(i32** %3, i32** %0, i32 %1)
%5 = tail call i32 @slide_map(i32** %3, i32 %1, i8 signext 117)
%6 = tail call i32 @slide_map(i32** %3, i32 %1, i8 signext 108)
%7 = tail call i32 @is_equal_map(i32** %3, i32** %0, i32 %1)
%8 = tail call i32 @game_over(i32** %3, i32 %1)
ret i32 %7
}