#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 */
scalar_t__ encontrouBau(char **, int, int, int /*<<< orphan*/,
                        int /*<<< orphan*/, char);
int /*<<< orphan*/ preencherMapa(char **, int, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main(void) {
  char mapa[128][128];
  int linhas, colunas;
  scanf("%d %d\n", &colunas, &linhas);
  preencherMapa(mapa, linhas, colunas);
  if (encontrouBau(mapa, linhas, colunas, 0, 0, mapa[0][0])) {
    printf("*\n");
  } else {
    printf("!\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x4020,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xea7(%rip),%rdi
lea    -0x4018(%rbp),%rsi
lea    -0x4014(%rbp),%rdx
call   1040 <scanf@plt>
lea    -0x4010(%rbp),%rdi
mov    -0x4014(%rbp),%esi
mov    -0x4018(%rbp),%edx
call   1060 <preencherMapa@plt>
lea    -0x4010(%rbp),%rdi
mov    -0x4014(%rbp),%esi
mov    -0x4018(%rbp),%edx
xor    %r8d,%r8d
mov    %r8d,%ecx
movsbl -0x4010(%rbp),%r9d
ff
call   1050 <encontrouBau@plt>
cmp    $0x0,%rax
je     11c5 <main+0x85>
lea    0xe4c(%rip),%rdi
call   1030 <printf@plt>
jmp    11d1 <main+0x91>
lea    0xe3e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x4020,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x4010,%rsp
lea    0xeb1(%rip),%rdi
lea    0x8(%rsp),%rsi
lea    0xc(%rsp),%rdx
call   1040 <scanf@plt>
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%edx
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
call   1060 <preencherMapa@plt>
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%edx
movsbl 0x10(%rsp),%r9d
mov    %rbx,%rdi
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1050 <encontrouBau@plt>
test   %rax,%rax
lea    0xe6f(%rip),%rax
lea    0xe6a(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x4010,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%d %d\0A\00"
@.str.1 = [3 x i8] c"*\0A\00"
@.str.2 = [3 x i8] c"!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [128 x [128 x i8]]
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %4, i32* %3)
%6 = getelementptr inbounds [128 x [128 x i8]], [128 x [128 x i8]]* %2, i64 0, i64 0
%7 = bitcast [128 x i8]* %6 to i8**
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = call i32 @preencherMapa(i8** %7, i32 %8, i32 %9)
%11 = getelementptr inbounds [128 x [128 x i8]], [128 x [128 x i8]]* %2, i64 0, i64 0
%12 = bitcast [128 x i8]* %11 to i8**
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = getelementptr inbounds [128 x [128 x i8]], [128 x [128 x i8]]* %2, i64 0, i64 0
%16 = getelementptr inbounds [128 x i8], [128 x i8]* %15, i64 0, i64 0
%17 = load i8, i8* %16
%18 = call i64 @encontrouBau(i8** %12, i32 %13, i32 %14, i32 0, i32 0, i8 signext %17)
%19 = icmp ne i64 %18, 0
br i1 %19, label %20, label %22
20: ; preds = %0
%21 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %24
22: ; preds = %0
%23 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %24
24: ; preds = %22, %20
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"%d %d\0A\00"
@str = [2 x i8] c"!\00"
@str.3 = [2 x i8] c"*\00"
define i32 @main() {
%1 = alloca [128 x [128 x i8]]
%2 = alloca i32
%3 = alloca i32
%4 = getelementptr inbounds [128 x [128 x i8]], [128 x [128 x i8]]* %1, i64 0, i64 0, i64 0
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %3, i32* %2)
%8 = bitcast [128 x [128 x i8]]* %1 to i8**
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = call i32 @preencherMapa(i8** %8, i32 %9, i32 %10)
%12 = load i32, i32* %2
%13 = load i32, i32* %3
%14 = load i8, i8* %4
%15 = call i64 @encontrouBau(i8** %8, i32 %12, i32 %13, i32 0, i32 0, i8 signext %14)
%16 = icmp eq i64 %15, 0
%17 = select i1 %16, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @str.3, i64 0, i64 0)
%18 = call i32 @puts(i8* dereferenceable(1) %17)
ret i32 0
}