#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, ...);
int /*<<< orphan*/ stdin;
char *strtok(char *, char *);
int main() {
  char line[30];
  fgets(line, 30, stdin);
  int oddProduct = 1, evenProduct = 1, isOdd = 1;
  char *token = strtok(line, " ");
  while (token != NULL) {
    int num = atoi(token);
    if (isOdd) {
      oddProduct *= num;
    } else {
      evenProduct *= num;
    }
    isOdd = !isOdd;
    token = strtok(NULL, " ");
  }
  if (oddProduct == evenProduct) {
    printf("yes\n%d\n", oddProduct);
  } else {
    printf("no\nodd_product = %d\neven_product = %d\n", oddProduct,
           evenProduct);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
mov    0x2e8e(%rip),%rax
mov    (%rax),%edx
mov    $0x1e,%esi
call   1040 <fgets@plt>
movl   $0x1,-0x34(%rbp)
movl   $0x1,-0x38(%rbp)
movl   $0x1,-0x3c(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xe7a(%rip),%rsi
call   1050 <strtok@plt>
mov    %rax,-0x48(%rbp)
cmpq   $0x0,-0x48(%rbp)
je     11f3 <main+0xb3>
mov    -0x48(%rbp),%rdi
call   1060 <atoi@plt>
mov    %eax,-0x4c(%rbp)
cmpl   $0x0,-0x3c(%rbp)
je     11bf <main+0x7f>
mov    -0x4c(%rbp),%eax
imul   -0x34(%rbp),%eax
mov    %eax,-0x34(%rbp)
jmp    11c9 <main+0x89>
mov    -0x4c(%rbp),%eax
imul   -0x38(%rbp),%eax
mov    %eax,-0x38(%rbp)
cmpl   $0x0,-0x3c(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x3c(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0xe1b(%rip),%rsi
call   1050 <strtok@plt>
mov    %rax,-0x48(%rbp)
jmp    118f <main+0x4f>
mov    -0x34(%rbp),%eax
cmp    -0x38(%rbp),%eax
jne    1215 <main+0xd5>
mov    -0x34(%rbp),%esi
lea    0xdf9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1229 <main+0xe9>
mov    -0x34(%rbp),%esi
mov    -0x38(%rbp),%edx
lea    0xde8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x20,%rsp
mov    0x2e95(%rip),%rax
mov    (%rax),%edx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x1e,%esi
call   1040 <fgets@plt>
lea    0xe94(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strtok@plt>
test   %rax,%rax
je     11e9 <main+0xa9>
mov    $0x1,%r15d
lea    0xe7a(%rip),%r14
mov    $0x1,%ebp
mov    $0x1,%ebx
mov    $0x1,%r12d
cs nopw 0x0(%rax,%rax,1)
mov    %rax,%rdi
call   1060 <atoi@plt>
test   %ebx,%ebx
mov    $0x1,%ecx
cmove  %eax,%ecx
cmove  %r15d,%eax
imul   %ecx,%r12d
imul   %eax,%ebp
xor    $0x1,%ebx
xor    %edi,%edi
mov    %r14,%rsi
call   1050 <strtok@plt>
test   %rax,%rax
jne    11a0 <main+0x60>
cmp    %r12d,%ebp
je     11ef <main+0xaf>
lea    0xe2f(%rip),%rdi
mov    %ebp,%esi
mov    %r12d,%edx
xor    %eax,%eax
call   1030 <printf@plt>
jmp    1200 <main+0xc0>
mov    $0x1,%r12d
lea    0xe0c(%rip),%rdi
mov    %r12d,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%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 = [8 x i8] c"yes\0A%d\0A\00"
@.str.2 = [39 x i8] c"no\0Aodd_product = %d\0Aeven_product = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [30 x i8]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
store i32 0, i32* %1
%8 = getelementptr inbounds [30 x i8], [30 x i8]* %2, i64 0, i64 0
%9 = load i32, i32* @stdin
%10 = call i32 @fgets(i8* %8, i32 30, i32 %9)
store i32 1, i32* %3
store i32 1, i32* %4
store i32 1, i32* %5
%11 = getelementptr inbounds [30 x i8], [30 x i8]* %2, i64 0, i64 0
%12 = call i8* @strtok(i8* %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i8* %12, i8** %6
br label %13
13: ; preds = %29, %0
%14 = load i8*, i8** %6
%15 = icmp ne i8* %14, null
br i1 %15, label %16, label %35
16: ; preds = %13
%17 = load i8*, i8** %6
%18 = call i32 @atoi(i8* %17)
store i32 %18, i32* %7
%19 = load i32, i32* %5
%20 = icmp ne i32 %19, 0
br i1 %20, label %21, label %25
21: ; preds = %16
%22 = load i32, i32* %7
%23 = load i32, i32* %3
%24 = mul nsw i32 %23, %22
store i32 %24, i32* %3
br label %29
25: ; preds = %16
%26 = load i32, i32* %7
%27 = load i32, i32* %4
%28 = mul nsw i32 %27, %26
store i32 %28, i32* %4
br label %29
29: ; preds = %25, %21
%30 = load i32, i32* %5
%31 = icmp ne i32 %30, 0
%32 = xor i1 %31, true
%33 = zext i1 %32 to i32
store i32 %33, i32* %5
%34 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i8* %34, i8** %6
br label %13
35: ; preds = %13
%36 = load i32, i32* %3
%37 = load i32, i32* %4
%38 = icmp eq i32 %36, %37
br i1 %38, label %39, label %42
39: ; preds = %35
%40 = load i32, i32* %3
%41 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %40)
br label %46
42: ; preds = %35
%43 = load i32, i32* %3
%44 = load i32, i32* %4
%45 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0), i32 %43, i32 %44)
br label %46
46: ; preds = %42, %39
ret i32 0
}

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