#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*/ assert(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 *);
int get_mod(char *);
int main() {
  FILE *fride = fopen("ride.in", "r");
  FILE *fout = fopen("ride.out", "w");
  assert(fride != NULL);
  char comet[9], group[7];
  fscanf(fride, "%s\n", comet);
  fscanf(fride, "%s\n", group);
  int comet_mod = get_mod(comet);
  int group_mod = get_mod(group);
  if (comet_mod == group_mod)
    fprintf(fout, "GO\n");
  else
    fprintf(fout, "STAY\n");
  fclose(fride);
  fclose(fout);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe8a(%rip),%rdi
lea    0xe8b(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,-0x10(%rbp)
lea    0xe7d(%rip),%rdi
lea    0xe7f(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x10(%rbp),%rdi
lea    -0x21(%rbp),%rdx
lea    0xe57(%rip),%rsi
call   1040 <fscanf@plt>
mov    -0x10(%rbp),%rdi
lea    -0x28(%rbp),%rdx
lea    0xe43(%rip),%rsi
call   1040 <fscanf@plt>
lea    -0x21(%rbp),%rdi
call   1070 <get_mod@plt>
mov    %eax,-0x2c(%rbp)
lea    -0x28(%rbp),%rdi
call   1070 <get_mod@plt>
mov    %eax,-0x30(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x30(%rbp),%eax
jne    1210 <main+0xb0>
mov    -0x18(%rbp),%rdi
lea    0xe13(%rip),%rsi
call   1060 <fprintf@plt>
jmp    1220 <main+0xc0>
mov    -0x18(%rbp),%rdi
lea    0xe02(%rip),%rsi
call   1060 <fprintf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xe8b(%rip),%rdi
lea    0xe8c(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,%rbx
lea    0xe7f(%rip),%rdi
lea    0xe81(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,%r14
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1050 <assert@plt>
lea    0xe66(%rip),%r15
lea    0xf(%rsp),%r12
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
call   1040 <fscanf@plt>
lea    0x8(%rsp),%r13
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r13,%rdx
call   1040 <fscanf@plt>
mov    %r12,%rdi
call   1060 <get_mod@plt>
mov    %eax,%ebp
mov    %r13,%rdi
call   1060 <get_mod@plt>
cmp    %eax,%ebp
jne    11f9 <main+0x99>
lea    0xe27(%rip),%rdi
mov    $0x3,%esi
jmp    1205 <main+0xa5>
lea    0xe1d(%rip),%rdi
mov    $0x5,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1080 <fwrite@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
mov    %r14,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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 = [4 x i8] c"%s\0A\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 [9 x i8]
%5 = alloca [7 x i8]
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %1
%8 = 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* %8, i32** %2
%9 = 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* %9, i32** %3
%10 = load i32*, i32** %2
%11 = icmp ne i32* %10, null
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
%14 = load i32*, i32** %2
%15 = getelementptr inbounds [9 x i8], [9 x i8]* %4, i64 0, i64 0
%16 = call i32 @fscanf(i32* %14, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* %15)
%17 = load i32*, i32** %2
%18 = getelementptr inbounds [7 x i8], [7 x i8]* %5, i64 0, i64 0
%19 = call i32 @fscanf(i32* %17, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* %18)
%20 = getelementptr inbounds [9 x i8], [9 x i8]* %4, i64 0, i64 0
%21 = call i32 @get_mod(i8* %20)
store i32 %21, i32* %6
%22 = getelementptr inbounds [7 x i8], [7 x i8]* %5, i64 0, i64 0
%23 = call i32 @get_mod(i8* %22)
store i32 %23, i32* %7
%24 = load i32, i32* %6
%25 = load i32, i32* %7
%26 = icmp eq i32 %24, %25
br i1 %26, label %27, label %30
27: ; preds = %0
%28 = load i32*, i32** %3
%29 = call i32 @fprintf(i32* %28, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
br label %33
30: ; preds = %0
%31 = load i32*, i32** %3
%32 = call i32 @fprintf(i32* %31, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
br label %33
33: ; preds = %30, %27
%34 = load i32*, i32** %2
%35 = call i32 @fclose(i32* %34)
%36 = load i32*, i32** %3
%37 = call i32 @fclose(i32* %36)
ret i32 0
}

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 = [4 x i8] c"%s\0A\00"
@.str.5 = [4 x i8] c"GO\0A\00"
@.str.6 = [6 x i8] c"STAY\0A\00"
define i32 @main() {
%1 = alloca [9 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 = icmp ne i32* %3, null
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
%8 = getelementptr inbounds [9 x i8], [9 x i8]* %1, i64 0, i64 0
%9 = getelementptr inbounds [7 x i8], [7 x i8]* %2, i64 0, i64 0
%10 = call i32 @fscanf(i32* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* %8)
%11 = call i32 @fscanf(i32* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* %9)
%12 = call i32 @get_mod(i8* %8)
%13 = call i32 @get_mod(i8* %9)
%14 = icmp eq i32 %12, %13
br i1 %14, label %15, label %17
15: ; preds = %0
%16 = call i64 @fwrite(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i64 3, i64 1, i32* %4)
br label %19
17: ; preds = %0
%18 = call i64 @fwrite(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), i64 5, i64 1, i32* %4)
br label %19
19: ; preds = %17, %15
%20 = call i32 @fclose(i32* %3)
%21 = call i32 @fclose(i32* %4)
ret i32 0
}