#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 carp(char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, char *, char *);
void main() {
  char a[100], b[100];
  FILE *in = fopen("ride.in", "r"), *out = fopen("ride.out", "w");
  fscanf(in, "%s\n%s\n", a, b);
  fclose(in);
  if (carp(a) % 47 == carp(b) % 47)
    fprintf(out, "GO\n");
  else
    fprintf(out, "STAY\n");
  fclose(out);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
lea    0xe8e(%rip),%rdi
lea    0xe8f(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0xe8(%rbp)
lea    0xe7e(%rip),%rdi
lea    0xe80(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0xf0(%rbp)
mov    -0xe8(%rbp),%rdi
lea    -0x70(%rbp),%rdx
lea    -0xe0(%rbp),%rcx
lea    0xe5d(%rip),%rsi
call   1040 <fscanf@plt>
mov    -0xe8(%rbp),%rdi
call   1030 <fclose@plt>
lea    -0x70(%rbp),%rdi
call   1060 <carp@plt>
mov    $0x2f,%ecx
cltd
idiv   %ecx
mov    %edx,-0xf4(%rbp)
lea    -0xe0(%rbp),%rdi
call   1060 <carp@plt>
mov    $0x2f,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
mov    -0xf4(%rbp),%edx
cmp    %eax,%edx
jne    121c <main+0xbc>
mov    -0xf0(%rbp),%rdi
lea    0xe0a(%rip),%rsi
call   1050 <fprintf@plt>
jmp    122f <main+0xcf>
mov    -0xf0(%rbp),%rdi
lea    0xdf6(%rip),%rsi
call   1050 <fprintf@plt>
mov    -0xf0(%rbp),%rdi
call   1030 <fclose@plt>
xor    %edi,%edi
call   1080 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0xd8,%rsp
lea    0xe8b(%rip),%rdi
lea    0xe8c(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,%rbx
lea    0xe7f(%rip),%rdi
lea    0xe81(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,%r15
lea    0xe74(%rip),%rsi
lea    0x70(%rsp),%r12
mov    %rsp,%r14
mov    %rbx,%rdi
mov    %r12,%rdx
mov    %r14,%rcx
call   1040 <fscanf@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
mov    %r12,%rdi
call   1050 <carp@plt>
movslq %eax,%rbx
imul   $0xffffffffae4c415d,%rbx,%rax
shr    $0x20,%rax
add    %ebx,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
sar    $0x5,%eax
add    %ecx,%eax
imul   $0x2f,%eax,%eax
sub    %eax,%ebx
mov    %r14,%rdi
call   1050 <carp@plt>
cltq
imul   $0xffffffffae4c415d,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x5,%ecx
add    %edx,%ecx
imul   $0x2f,%ecx,%ecx
sub    %ecx,%eax
xor    %ecx,%ecx
cmp    %eax,%ebx
setne  %cl
lea    0x3(%rcx,%rcx,1),%rsi
lea    0xdfd(%rip),%rax
lea    0xdfa(%rip),%rdi
cmove  %rax,%rdi
mov    $0x1,%edx
mov    %r15,%rcx
call   1080 <fwrite@plt>
mov    %r15,%rdi
call   1030 <fclose@plt>
xor    %edi,%edi
call   1070 <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 = [7 x i8] c"%s\0A%s\0A\00"
@.str.5 = [4 x i8] c"GO\0A\00"
@.str.6 = [6 x i8] c"STAY\0A\00"
define void @main() {
%1 = alloca [100 x i8]
%2 = alloca [100 x i8]
%3 = alloca i32*
%4 = alloca i32*
%5 = 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* %5, i32** %3
%6 = 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* %6, i32** %4
%7 = load i32*, i32** %3
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%10 = call i32 @fscanf(i32* %7, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8* %8, i8* %9)
%11 = load i32*, i32** %3
%12 = call i32 @fclose(i32* %11)
%13 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%14 = call i32 @carp(i8* %13)
%15 = srem i32 %14, 47
%16 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%17 = call i32 @carp(i8* %16)
%18 = srem i32 %17, 47
%19 = icmp eq i32 %15, %18
br i1 %19, label %20, label %23
20: ; preds = %0
%21 = load i32*, i32** %4
%22 = call i32 @fprintf(i32* %21, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
br label %26
23: ; preds = %0
%24 = load i32*, i32** %4
%25 = call i32 @fprintf(i32* %24, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
br label %26
26: ; preds = %23, %20
%27 = load i32*, i32** %4
%28 = call i32 @fclose(i32* %27)
%29 = 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 = [7 x i8] c"%s\0A%s\0A\00"
@.str.5 = [4 x i8] c"GO\0A\00"
@.str.6 = [6 x i8] c"STAY\0A\00"
define void @main() {
%1 = alloca [100 x i8]
%2 = alloca [100 x i8]
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%5 = 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))
%6 = 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))
%7 = call i32 @fscanf(i32* %5, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8* %3, i8* %4)
%8 = call i32 @fclose(i32* %5)
%9 = call i32 @carp(i8* %3)
%10 = srem i32 %9, 47
%11 = call i32 @carp(i8* %4)
%12 = srem i32 %11, 47
%13 = icmp eq i32 %10, %12
%14 = select i1 %13, i64 3, i64 5
%15 = select i1 %13, 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)
%16 = call i64 @fwrite(i8* %15, i64 %14, i64 1, i32* %6)
%17 = call i32 @fclose(i32* %6)
%18 = call i32 @exit(i32 0)
unreachable
}