#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 */
scalar_t__ calu(char *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, char *);
int main() {
  FILE *fin = fopen("ride.in", "r");
  FILE *fout = fopen("ride.out", "w");
  char a[8], b[8];
  fscanf(fin, "%s", a);
  fscanf(fin, "%s", b);
  if (calu(a) == calu(b))
    fprintf(fout, "%s\n", "GO");
  else
    fprintf(fout, "%s\n", "STAY");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
lea    0xeab(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x10(%rbp)
lea    0xe9d(%rip),%rdi
lea    0xe9f(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x20(%rbp),%rdx
lea    0xe89(%rip),%rsi
call   1030 <fscanf@plt>
mov    -0x10(%rbp),%rdi
lea    -0x28(%rbp),%rdx
lea    0xe75(%rip),%rsi
call   1030 <fscanf@plt>
lea    -0x20(%rbp),%rdi
call   1040 <calu@plt>
mov    %rax,-0x30(%rbp)
lea    -0x28(%rbp),%rdi
call   1040 <calu@plt>
mov    %rax,%rcx
mov    -0x30(%rbp),%rax
cmp    %rcx,%rax
jne    11e7 <main+0xa7>
mov    -0x18(%rbp),%rdi
lea    0xe42(%rip),%rsi
lea    0xe3f(%rip),%rdx
call   1050 <fprintf@plt>
jmp    11fe <main+0xbe>
mov    -0x18(%rbp),%rdi
lea    0xe26(%rip),%rsi
lea    0xe26(%rip),%rdx
call   1050 <fprintf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
lea    0xeac(%rip),%rdi
lea    0xead(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,%rbx
lea    0xea0(%rip),%rdi
lea    0xea2(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,%r14
lea    0xe95(%rip),%r15
lea    0x8(%rsp),%r12
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
call   1030 <fscanf@plt>
mov    %rsp,%r13
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r13,%rdx
call   1030 <fscanf@plt>
mov    %r12,%rdi
call   1040 <calu@plt>
mov    %rax,%rbx
mov    %r13,%rdi
call   1040 <calu@plt>
cmp    %rax,%rbx
lea    0xe5b(%rip),%rax
lea    0xe57(%rip),%rdx
cmove  %rax,%rdx
lea    0xe45(%rip),%rsi
mov    %r14,%rdi
call   1050 <fprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
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 = [3 x i8] c"%s\00"
@.str.5 = [4 x i8] c"%s\0A\00"
@.str.6 = [3 x i8] c"GO\00"
@.str.7 = [5 x i8] c"STAY\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca [8 x i8]
%5 = alloca [8 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 [8 x i8], [8 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 [8 x i8], [8 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 [8 x i8], [8 x i8]* %4, i64 0, i64 0
%15 = call i64 @calu(i8* %14)
%16 = getelementptr inbounds [8 x i8], [8 x i8]* %5, i64 0, i64 0
%17 = call i64 @calu(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), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
br label %25
22: ; preds = %0
%23 = load i32*, i32** %3
%24 = call i32 @fprintf(i32* %23, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
br label %25
25: ; preds = %22, %19
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 = [3 x i8] c"%s\00"
@.str.5 = [4 x i8] c"%s\0A\00"
@.str.6 = [3 x i8] c"GO\00"
@.str.7 = [5 x i8] c"STAY\00"
define i32 @main() {
%1 = alloca [8 x i8]
%2 = alloca [8 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 [8 x i8], [8 x i8]* %1, i64 0, i64 0
%6 = getelementptr inbounds [8 x i8], [8 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 @calu(i8* %5)
%10 = call i64 @calu(i8* %6)
%11 = icmp eq i64 %9, %10
%12 = select i1 %11, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0)
%13 = call i32 @fprintf(i32* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* %12)
ret i32 0
}