#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__ fight(int *, int, int *, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *, ...);
void test_case() {
  int g, m;
  scanf("%d %d", &g, &m);
  int army_g[g];
  int army_m[m];
  for (int i = 0; i < g; i++)
    scanf("%d", army_g + i);
  for (int i = 0; i < m; i++)
    scanf("%d", army_m + i);
  printf(fight(army_g, g, army_m, m) ? "Godzilla\n" : "MechaGodzilla\n");
}


x86 assembly (clang, -O0):
<test_case>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    0xec1(%rip),%rdi
xor    %eax,%eax
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
call   1050 <scanf@plt>
mov    -0x4(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x38(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x30(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    11d3 <test_case+0xa3>
mov    -0x38(%rbp),%rsi
movslq -0x24(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe45(%rip),%rdi
mov    $0x0,%al
call   1050 <scanf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    119c <test_case+0x6c>
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1211 <test_case+0xe1>
mov    -0x30(%rbp),%rsi
movslq -0x28(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe07(%rip),%rdi
mov    $0x0,%al
call   1050 <scanf@plt>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    11da <test_case+0xaa>
mov    -0x30(%rbp),%rdx
mov    -0x38(%rbp),%rdi
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%ecx
call   1040 <fight@plt>
mov    %rax,%rcx
lea    0xdd8(%rip),%rdi
lea    0xdd6(%rip),%rax
cmp    $0x0,%rcx
cmovne %rax,%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_case>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xeb8(%rip),%rdi
lea    -0x2c(%rbp),%rsi
lea    -0x30(%rbp),%rdx
xor    %eax,%eax
call   1050 <scanf@plt>
mov    %rsp,-0x38(%rbp)
mov    -0x2c(%rbp),%eax
mov    %rsp,%r14
lea    0xf(,%rax,4),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r14
mov    %r14,%rsp
mov    -0x30(%rbp),%ecx
mov    %rsp,%r15
lea    0xf(,%rcx,4),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r15
mov    %r15,%rsp
mov    -0x2c(%rbp),%esi
test   %esi,%esi
jle    11c1 <test_case+0x91>
lea    0xe6a(%rip),%r12
mov    %r14,%rbx
xor    %r13d,%r13d
nop
mov    %r12,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
add    $0x1,%r13
movslq -0x2c(%rbp),%rsi
add    $0x4,%rbx
cmp    %rsi,%r13
jl     11a0 <test_case+0x70>
mov    -0x30(%rbp),%ecx
test   %ecx,%ecx
jle    1201 <test_case+0xd1>
lea    0xe37(%rip),%r12
mov    %r15,%r13
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r12,%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
add    $0x1,%rbx
movslq -0x30(%rbp),%rcx
add    $0x4,%r13
cmp    %rcx,%rbx
jl     11e0 <test_case+0xb0>
mov    -0x2c(%rbp),%esi
mov    %r14,%rdi
mov    %r15,%rdx
call   1040 <fight@plt>
test   %rax,%rax
lea    0xdf0(%rip),%rax
lea    0xdee(%rip),%rdi
cmove  %rax,%rdi
call   1030 <printf@plt>
mov    -0x38(%rbp),%rsp
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [10 x i8] c"Godzilla\0A\00"
@.str.3 = [15 x i8] c"MechaGodzilla\0A\00"
define void @test_case() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
%6 = alloca i32
%7 = alloca i32
%8 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%9 = load i32, i32* %1
%10 = zext i32 %9 to i64
%11 = call i8* @llvm.stacksave()
store i8* %11, i8** %3
%12 = alloca i32, i64 %10
store i64 %10, i64* %4
%13 = load i32, i32* %2
%14 = zext i32 %13 to i64
%15 = alloca i32, i64 %14
store i64 %14, i64* %5
store i32 0, i32* %6
br label %16
16: ; preds = %25, %0
%17 = load i32, i32* %6
%18 = load i32, i32* %1
%19 = icmp slt i32 %17, %18
br i1 %19, label %20, label %28
20: ; preds = %16
%21 = load i32, i32* %6
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i32, i32* %12, i64 %22
%24 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %23)
br label %25
25: ; preds = %20
%26 = load i32, i32* %6
%27 = add nsw i32 %26, 1
store i32 %27, i32* %6
br label %16
28: ; preds = %16
store i32 0, i32* %7
br label %29
29: ; preds = %38, %28
%30 = load i32, i32* %7
%31 = load i32, i32* %2
%32 = icmp slt i32 %30, %31
br i1 %32, label %33, label %41
33: ; preds = %29
%34 = load i32, i32* %7
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds i32, i32* %15, i64 %35
%37 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %36)
br label %38
38: ; preds = %33
%39 = load i32, i32* %7
%40 = add nsw i32 %39, 1
store i32 %40, i32* %7
br label %29
41: ; preds = %29
%42 = load i32, i32* %1
%43 = load i32, i32* %2
%44 = call i64 @fight(i32* %12, i32 %42, i32* %15, i32 %43)
%45 = icmp ne i64 %44, 0
%46 = zext i1 %45 to i64
%47 = select i1 %45, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0)
%48 = call i32 @printf(i8* %47)
%49 = load i8*, i8** %3
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [10 x i8] c"Godzilla\0A\00"
@.str.3 = [15 x i8] c"MechaGodzilla\0A\00"
define void @test_case() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = zext i32 %6 to i64
%8 = call i8* @llvm.stacksave()
%9 = alloca i32, i64 %7
%10 = load i32, i32* %2
%11 = zext i32 %10 to i64
%12 = alloca i32, i64 %11
%13 = load i32, i32* %1
%14 = icmp sgt i32 %13, 0
br i1 %14, label %21, label %17
15: ; preds = %21
%16 = load i32, i32* %2
br label %17
17: ; preds = %15, %0
%18 = phi i32 [ %26, %15 ], [ %13, %0 ]
%19 = phi i32 [ %16, %15 ], [ %10, %0 ]
%20 = icmp sgt i32 %19, 0
br i1 %20, label %38, label %31
21: ; preds = %0, %21
%22 = phi i64 [ %25, %21 ], [ 0, %0 ]
%23 = getelementptr inbounds i32, i32* %9, i64 %22
%24 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %23)
%25 = add nuw nsw i64 %22, 1
%26 = load i32, i32* %1
%27 = sext i32 %26 to i64
%28 = icmp slt i64 %25, %27
br i1 %28, label %21, label %15
29: ; preds = %38
%30 = load i32, i32* %1
br label %31
31: ; preds = %29, %17
%32 = phi i32 [ %18, %17 ], [ %30, %29 ]
%33 = phi i32 [ %19, %17 ], [ %43, %29 ]
%34 = call i64 @fight(i32* %9, i32 %32, i32* %12, i32 %33)
%35 = icmp eq i64 %34, 0
%36 = select i1 %35, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0)
%37 = call i32 @printf(i8* dereferenceable(1) %36)
ret void
38: ; preds = %17, %38
%39 = phi i64 [ %42, %38 ], [ 0, %17 ]
%40 = getelementptr inbounds i32, i32* %12, i64 %39
%41 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %40)
%42 = add nuw nsw i64 %39, 1
%43 = load i32, i32* %2
%44 = sext i32 %43 to i64
%45 = icmp slt i64 %42, %44
br i1 %45, label %38, label %29
}