#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 *, char *);
int strlen(char *);
int main(void) {
  char board[51];
  scanf("%s", board);
  if (board[0] == board[strlen(board) - 1]) {
    printf("%c\n", board[0]);
  } else {
    printf("o\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x40(%rbp),%rsi
lea    0xeb6(%rip),%rdi
call   1050 <scanf@plt>
movsbl -0x40(%rbp),%eax
mov    %eax,-0x44(%rbp)
lea    -0x40(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x44(%rbp),%eax
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl -0x40(%rbp,%rcx,1),%ecx
cmp    %ecx,%eax
jne    118e <main+0x5e>
movsbl -0x40(%rbp),%esi
lea    0xe81(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    119c <main+0x6c>
lea    0xe72(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x38,%rsp
lea    0xeb2(%rip),%rdi
mov    %rsp,%r14
mov    %r14,%rsi
call   1060 <scanf@plt>
mov    (%rsp),%bl
mov    %r14,%rdi
call   1040 <strlen@plt>
cltq
cmp    -0x1(%rax,%r14,1),%bl
jne    1181 <main+0x41>
movsbl (%rsp),%esi
lea    0xe8b(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    118d <main+0x4d>
lea    0xe7f(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [4 x i8] c"%c\0A\00"
@.str.2 = [3 x i8] c"o\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [51 x i8]
store i32 0, i32* %1
%3 = getelementptr inbounds [51 x i8], [51 x i8]* %2, i64 0, i64 0
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = getelementptr inbounds [51 x i8], [51 x i8]* %2, i64 0, i64 0
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = getelementptr inbounds [51 x i8], [51 x i8]* %2, i64 0, i64 0
%9 = call i32 @strlen(i8* %8)
%10 = sub nsw i32 %9, 1
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [51 x i8], [51 x i8]* %2, i64 0, i64 %11
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp eq i32 %7, %14
br i1 %15, label %16, label %21
16: ; preds = %0
%17 = getelementptr inbounds [51 x i8], [51 x i8]* %2, i64 0, i64 0
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %19)
br label %23
21: ; preds = %0
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %23
23: ; preds = %21, %16
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [4 x i8] c"%c\0A\00"
@str = [2 x i8] c"o\00"
define i32 @main() {
%1 = alloca [51 x i8]
%2 = getelementptr inbounds [51 x i8], [51 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = load i8, i8* %2
%5 = call i32 @strlen(i8* %2)
%6 = add nsw i32 %5, -1
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds [51 x i8], [51 x i8]* %1, i64 0, i64 %7
%9 = load i8, i8* %8
%10 = icmp eq i8 %4, %9
br i1 %10, label %11, label %15
11: ; preds = %0
%12 = load i8, i8* %2
%13 = sext i8 %12 to i32
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %13)
br label %17
15: ; preds = %0
%16 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
br label %17
17: ; preds = %15, %11
ret i32 0
}