#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*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, char *);
scalar_t__ hash2(char *);
int main(void) {
  FILE *fin = fopen("ride.in", "r");
  FILE *fout = fopen("ride.out", "w");
  char a[7], b[7];
  fscanf(fin, "%s", a);
  fscanf(fin, "%s", b);
  if (hash2(a) == hash2(b))
    fprintf(fout, "GO\n");
  else
    fprintf(fout, "STAY\n");
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe9a(%rip),%rdi
lea    0xe9b(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x10(%rbp)
lea    0xe8d(%rip),%rdi
lea    0xe8f(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x1f(%rbp),%rdx
lea    0xe79(%rip),%rsi
call   1040 <fscanf@plt>
mov    -0x10(%rbp),%rdi
lea    -0x26(%rbp),%rdx
lea    0xe65(%rip),%rsi
call   1040 <fscanf@plt>
lea    -0x1f(%rbp),%rdi
call   1030 <hash2@plt>
mov    %rax,-0x30(%rbp)
lea    -0x26(%rbp),%rdi
call   1030 <hash2@plt>
mov    %rax,%rcx
mov    -0x30(%rbp),%rax
cmp    %rcx,%rax
jne    11f0 <main+0xa0>
mov    -0x18(%rbp),%rdi
lea    0xe32(%rip),%rsi
call   1050 <fprintf@plt>
jmp    1200 <main+0xb0>
mov    -0x18(%rbp),%rdi
lea    0xe21(%rip),%rsi
call   1050 <fprintf@plt>
xor    %edi,%edi
call   1070 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
lea    0xe9c(%rip),%rdi
lea    0xe9d(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%rbx
lea    0xe90(%rip),%rdi
lea    0xe92(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%r14
lea    0xe85(%rip),%r15
lea    0x9(%rsp),%r12
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
call   1040 <fscanf@plt>
lea    0x2(%rsp),%r13
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r13,%rdx
call   1040 <fscanf@plt>
mov    %r12,%rdi
call   1030 <hash2@plt>
mov    %rax,%rbx
mov    %r13,%rdi
call   1030 <hash2@plt>
xor    %ecx,%ecx
cmp    %rax,%rbx
setne  %cl
lea    0x3(%rcx,%rcx,1),%rsi
lea    0xe3b(%rip),%rax
lea    0xe38(%rip),%rdi
cmove  %rax,%rdi
mov    $0x1,%edx
mov    %r14,%rcx
call   1070 <fwrite@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"ride.in\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [9 x i8] c"ride.out\00"
@.str.3 = [2 x i8] c"w\00"
@.str.4 = [3 x i8] c"%s\00"
@.str.5 = [4 x i8] c"GO\0A\00"
@.str.6 = [6 x i8] c"STAY\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca [7 x i8]
%5 = alloca [7 x i8]
store i32 0, i32* %1
%6 = call i32* @fopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %6, i32** %2
%7 = call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32* %7, i32** %3
%8 = load i32*, i32** %2
%9 = getelementptr inbounds [7 x i8], [7 x i8]* %4, i64 0, i64 0
%10 = call i32 @fscanf(i32* %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %9)
%11 = load i32*, i32** %2
%12 = getelementptr inbounds [7 x i8], [7 x i8]* %5, i64 0, i64 0
%13 = call i32 @fscanf(i32* %11, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %12)
%14 = getelementptr inbounds [7 x i8], [7 x i8]* %4, i64 0, i64 0
%15 = call i64 @hash2(i8* %14)
%16 = getelementptr inbounds [7 x i8], [7 x i8]* %5, i64 0, i64 0
%17 = call i64 @hash2(i8* %16)
%18 = icmp eq i64 %15, %17
br i1 %18, label %19, label %22
19: ; preds = %0
%20 = load i32*, i32** %3
%21 = call i32 @fprintf(i32* %20, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
br label %25
22: ; preds = %0
%23 = load i32*, i32** %3
%24 = call i32 @fprintf(i32* %23, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
br label %25
25: ; preds = %22, %19
%26 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [8 x i8] c"ride.in\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [9 x i8] c"ride.out\00"
@.str.3 = [2 x i8] c"w\00"
@.str.4 = [3 x i8] c"%s\00"
@.str.5 = [4 x i8] c"GO\0A\00"
@.str.6 = [6 x i8] c"STAY\0A\00"
define i32 @main() {
%1 = alloca [7 x i8]
%2 = alloca [7 x i8]
%3 = tail call i32* @fopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%5 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 0
%6 = getelementptr inbounds [7 x i8], [7 x i8]* %2, i64 0, i64 0
%7 = call i32 @fscanf(i32* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %5)
%8 = call i32 @fscanf(i32* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %6)
%9 = call i64 @hash2(i8* %5)
%10 = call i64 @hash2(i8* %6)
%11 = icmp eq i64 %9, %10
%12 = select i1 %11, i64 3, i64 5
%13 = select i1 %11, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0)
%14 = call i64 @fwrite(i8* %13, i64 %12, i64 1, i32* %4)
%15 = call i32 @exit(i32 0)
unreachable
}