#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*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *, ...);
int main() {
  while (1) {
    int iSX;
    int iSY;
    scanf("%d%d", &iSX, &iSY);
    int max = 0;
    int imax = 0;
    for (int i = 0; i < 8; i++) {
      int mountainH;
      scanf("%d", &mountainH);
      if (mountainH > max) {
        max = mountainH;
        imax = i;
      }
    }
    if (iSX == imax) {
      printf("FIRE\n");
    } else {
      printf("HOLD\n");
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
mov    $0x0,%al
call   1040 <scanf@plt>
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x8,-0x18(%rbp)
jge    11a1 <main+0x81>
lea    0xe97(%rip),%rdi
lea    -0x1c(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x1c(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    118e <main+0x6e>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1193 <main+0x73>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    115a <main+0x3a>
mov    -0x8(%rbp),%eax
cmp    -0x14(%rbp),%eax
jne    11be <main+0x9e>
lea    0xe51(%rip),%rdi
call   1030 <printf@plt>
jmp    11ca <main+0xaa>
lea    0xe46(%rip),%rdi
call   1030 <printf@plt>
jmp    112f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xecd(%rip),%r13
lea    0xc(%rsp),%rbx
lea    0xec9(%rip),%r15
lea    0xebd(%rip),%r12
nopl   0x0(%rax,%rax,1)
lea    0xea9(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0x14(%rsp),%rdx
xor    %eax,%eax
call   1040 <scanf@plt>
mov    %r13,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0xc(%rsp),%ebp
test   %ebp,%ebp
mov    $0x0,%eax
cmovs  %eax,%ebp
mov    %r13,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0xc(%rsp),%eax
xor    %r14d,%r14d
cmp    %ebp,%eax
setg   %r14b
cmovg  %eax,%ebp
mov    %r13,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0xc(%rsp),%eax
cmp    %ebp,%eax
cmovg  %eax,%ebp
mov    $0x2,%eax
cmovg  %eax,%r14d
mov    %r13,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0xc(%rsp),%eax
cmp    %ebp,%eax
cmovg  %eax,%ebp
mov    $0x3,%eax
cmovg  %eax,%r14d
mov    %r13,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0xc(%rsp),%eax
cmp    %ebp,%eax
cmovg  %eax,%ebp
mov    $0x4,%eax
cmovg  %eax,%r14d
mov    %r13,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0xc(%rsp),%eax
cmp    %ebp,%eax
cmovg  %eax,%ebp
mov    $0x5,%eax
cmovg  %eax,%r14d
mov    %r13,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0xc(%rsp),%eax
cmp    %ebp,%eax
cmovg  %eax,%ebp
mov    $0x6,%eax
cmovg  %eax,%r14d
mov    %r13,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
cmp    %ebp,0xc(%rsp)
mov    $0x7,%eax
cmovg  %eax,%r14d
cmp    %r14d,0x10(%rsp)
mov    %r12,%rdi
cmove  %r15,%rdi
call   1030 <puts@plt>
jmp    1150 <main+0x30>

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

LLVM IR (-O2):
@.str = [5 x i8] c"%d%d\00"
@.str.1 = [3 x i8] c"%d\00"
@str = [5 x i8] c"HOLD\00"
@str.4 = [5 x i8] c"FIRE\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
br label %7
7: ; preds = %0, %7
%8 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%9 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%10 = load i32, i32* %3
%11 = icmp sgt i32 %10, 0
%12 = select i1 %11, i32 %10, i32 0
%13 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%14 = load i32, i32* %3
%15 = icmp sgt i32 %14, %12
%16 = select i1 %15, i32 %14, i32 %12
%17 = zext i1 %15 to i32
%18 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%19 = load i32, i32* %3
%20 = icmp sgt i32 %19, %16
%21 = select i1 %20, i32 %19, i32 %16
%22 = select i1 %20, i32 2, i32 %17
%23 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%24 = load i32, i32* %3
%25 = icmp sgt i32 %24, %21
%26 = select i1 %25, i32 %24, i32 %21
%27 = select i1 %25, i32 3, i32 %22
%28 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%29 = load i32, i32* %3
%30 = icmp sgt i32 %29, %26
%31 = select i1 %30, i32 %29, i32 %26
%32 = select i1 %30, i32 4, i32 %27
%33 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%34 = load i32, i32* %3
%35 = icmp sgt i32 %34, %31
%36 = select i1 %35, i32 %34, i32 %31
%37 = select i1 %35, i32 5, i32 %32
%38 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%39 = load i32, i32* %3
%40 = icmp sgt i32 %39, %36
%41 = select i1 %40, i32 %39, i32 %36
%42 = select i1 %40, i32 6, i32 %37
%43 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%44 = load i32, i32* %3
%45 = icmp sgt i32 %44, %41
%46 = select i1 %45, i32 7, i32 %42
%47 = load i32, i32* %1
%48 = icmp eq i32 %47, %46
%49 = select i1 %48, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @str.4, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0)
%50 = call i32 @puts(i8* dereferenceable(1) %49)
br label %7
}