#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 atoi(char *);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stdin;
int strlen(char *);
char *strtok(char *, char *);
int main() {
  char readLine[64];
  fgets(readLine, 64, stdin);
  int length = strlen(readLine);
  if (readLine[length - 1] == '\n') {
    readLine[length - 1] == '\0';
  }
  int evenProduct = 1, oddProduct = 1, isEven = 0;
  char *numberAsString = strtok(readLine, " ");
  while (numberAsString != NULL) {
    int currentNum = atoi(numberAsString);
    if (isEven) {
      evenProduct *= currentNum;
    } else {
      oddProduct *= currentNum;
    }
    isEven = !isEven;
    numberAsString = strtok(NULL, " ");
  }
  if (evenProduct == oddProduct) {
    printf("Yes\n");
    printf("Product = %d", evenProduct);
  } else {
    printf("No\n");
    printf("odd_product = %d\n", oddProduct);
    printf("even_product = %d\n", evenProduct);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x50(%rbp),%rdi
mov    0x2e7e(%rip),%rax
mov    (%rax),%edx
mov    $0x40,%esi
call   1050 <fgets@plt>
lea    -0x50(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x54(%rbp)
mov    -0x54(%rbp),%eax
sub    $0x1,%eax
cltq
movsbl -0x50(%rbp,%rax,1),%eax
cmp    $0xa,%eax
jne    1198 <main+0x48>
movl   $0x1,-0x58(%rbp)
movl   $0x1,-0x5c(%rbp)
movl   $0x0,-0x60(%rbp)
lea    -0x50(%rbp),%rdi
lea    0xe48(%rip),%rsi
call   1060 <strtok@plt>
mov    %rax,-0x68(%rbp)
cmpq   $0x0,-0x68(%rbp)
je     1225 <main+0xd5>
mov    -0x68(%rbp),%rdi
call   1070 <atoi@plt>
mov    %eax,-0x6c(%rbp)
cmpl   $0x0,-0x60(%rbp)
je     11f1 <main+0xa1>
mov    -0x6c(%rbp),%eax
imul   -0x58(%rbp),%eax
mov    %eax,-0x58(%rbp)
jmp    11fb <main+0xab>
mov    -0x6c(%rbp),%eax
imul   -0x5c(%rbp),%eax
mov    %eax,-0x5c(%rbp)
cmpl   $0x0,-0x60(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x60(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0xde9(%rip),%rsi
call   1060 <strtok@plt>
mov    %rax,-0x68(%rbp)
jmp    11c1 <main+0x71>
mov    -0x58(%rbp),%eax
cmp    -0x5c(%rbp),%eax
jne    1255 <main+0x105>
lea    0xdca(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x58(%rbp),%esi
lea    0xdbe(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1285 <main+0x135>
lea    0xdb8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x5c(%rbp),%esi
lea    0xdab(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x58(%rbp),%esi
lea    0xdac(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x40,%rsp
mov    0x2e75(%rip),%rax
mov    (%rax),%edx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x40,%esi
call   1060 <fgets@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
lea    0xe6c(%rip),%rsi
mov    %rbx,%rdi
call   1070 <strtok@plt>
test   %rax,%rax
je     121c <main+0xbc>
xor    %ebx,%ebx
mov    $0x1,%r12d
lea    0xe50(%rip),%r14
mov    $0x1,%ebp
mov    $0x1,%r15d
nopl   0x0(%rax,%rax,1)
mov    %rax,%rdi
call   1080 <atoi@plt>
test   %ebx,%ebx
mov    $0x1,%ecx
cmove  %eax,%ecx
cmove  %r12d,%eax
imul   %ecx,%r15d
imul   %eax,%ebp
xor    $0x1,%ebx
xor    %edi,%edi
mov    %r14,%rsi
call   1070 <strtok@plt>
test   %rax,%rax
jne    11c0 <main+0x60>
cmp    %r15d,%ebp
je     1222 <main+0xc2>
lea    0xe39(%rip),%rdi
call   1030 <puts@plt>
lea    0xe08(%rip),%rdi
mov    %r15d,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe09(%rip),%rdi
mov    %ebp,%esi
jmp    1238 <main+0xd8>
mov    $0x1,%r15d
lea    0xe0e(%rip),%rdi
call   1030 <puts@plt>
lea    0xdcd(%rip),%rdi
mov    %r15d,%esi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stdin = global i32 0
@.str = [2 x i8] c" \00"
@.str.1 = [5 x i8] c"Yes\0A\00"
@.str.2 = [13 x i8] c"Product = %d\00"
@.str.3 = [4 x i8] c"No\0A\00"
@.str.4 = [18 x i8] c"odd_product = %d\0A\00"
@.str.5 = [19 x i8] c"even_product = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [64 x i8]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i32 0, i32* %1
%9 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 0
%10 = load i32, i32* @stdin
%11 = call i32 @fgets(i8* %9, i32 64, i32 %10)
%12 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 0
%13 = call i32 @strlen(i8* %12)
store i32 %13, i32* %3
%14 = load i32, i32* %3
%15 = sub nsw i32 %14, 1
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 %16
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp eq i32 %19, 10
br i1 %20, label %21, label %30
21: ; preds = %0
%22 = load i32, i32* %3
%23 = sub nsw i32 %22, 1
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 %24
%26 = load i8, i8* %25
%27 = sext i8 %26 to i32
%28 = icmp eq i32 %27, 0
%29 = zext i1 %28 to i32
br label %30
30: ; preds = %21, %0
store i32 1, i32* %4
store i32 1, i32* %5
store i32 0, i32* %6
%31 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 0
%32 = call i8* @strtok(i8* %31, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i8* %32, i8** %7
br label %33
33: ; preds = %49, %30
%34 = load i8*, i8** %7
%35 = icmp ne i8* %34, null
br i1 %35, label %36, label %55
36: ; preds = %33
%37 = load i8*, i8** %7
%38 = call i32 @atoi(i8* %37)
store i32 %38, i32* %8
%39 = load i32, i32* %6
%40 = icmp ne i32 %39, 0
br i1 %40, label %41, label %45
41: ; preds = %36
%42 = load i32, i32* %8
%43 = load i32, i32* %4
%44 = mul nsw i32 %43, %42
store i32 %44, i32* %4
br label %49
45: ; preds = %36
%46 = load i32, i32* %8
%47 = load i32, i32* %5
%48 = mul nsw i32 %47, %46
store i32 %48, i32* %5
br label %49
49: ; preds = %45, %41
%50 = load i32, i32* %6
%51 = icmp ne i32 %50, 0
%52 = xor i1 %51, true
%53 = zext i1 %52 to i32
store i32 %53, i32* %6
%54 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i8* %54, i8** %7
br label %33
55: ; preds = %33
%56 = load i32, i32* %4
%57 = load i32, i32* %5
%58 = icmp eq i32 %56, %57
br i1 %58, label %59, label %63
59: ; preds = %55
%60 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%61 = load i32, i32* %4
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 %61)
br label %69
63: ; preds = %55
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%65 = load i32, i32* %5
%66 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), i32 %65)
%67 = load i32, i32* %4
%68 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0), i32 %67)
br label %69
69: ; preds = %63, %59
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
@.str = [2 x i8] c" \00"
@.str.2 = [13 x i8] c"Product = %d\00"
@.str.4 = [18 x i8] c"odd_product = %d\0A\00"
@.str.5 = [19 x i8] c"even_product = %d\0A\00"
@str = [3 x i8] c"No\00"
@str.6 = [4 x i8] c"Yes\00"
define i32 @main() {
%1 = alloca [64 x i8]
%2 = getelementptr inbounds [64 x i8], [64 x i8]* %1, i64 0, i64 0
%3 = load i32, i32* @stdin
%4 = call i32 @fgets(i8* %2, i32 64, i32 %3)
%5 = call i32 @strlen(i8* %2)
%6 = call i8* @strtok(i8* %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%7 = icmp eq i8* %6, null
br i1 %7, label %24, label %8
8: ; preds = %0, %8
%9 = phi i32 [ %18, %8 ], [ 1, %0 ]
%10 = phi i8* [ %20, %8 ], [ %6, %0 ]
%11 = phi i32 [ %19, %8 ], [ 0, %0 ]
%12 = phi i32 [ %16, %8 ], [ 1, %0 ]
%13 = call i32 @atoi(i8* %10)
%14 = icmp eq i32 %11, 0
%15 = select i1 %14, i32 %13, i32 1
%16 = mul nsw i32 %15, %12
%17 = select i1 %14, i32 1, i32 %13
%18 = mul nsw i32 %17, %9
%19 = xor i32 %11, 1
%20 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%21 = icmp eq i8* %20, null
br i1 %21, label %22, label %8
22: ; preds = %8
%23 = icmp eq i32 %18, %16
br i1 %23, label %24, label %28
24: ; preds = %0, %22
%25 = phi i32 [ %16, %22 ], [ 1, %0 ]
%26 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str.6, i64 0, i64 0))
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 %25)
br label %32
28: ; preds = %22
%29 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
%30 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), i32 %16)
%31 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0), i32 %18)
br label %32
32: ; preds = %28, %24
ret i32 0
}