#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 scanf(char *, int *);
int main() {
  int a[100];
  int n = 0;
  while (scanf("%d", &a[n++]) == 1 && a[n - 1] != 0)
    ;
  if (2 == n) {
    printf("0 0");
    return 0;
  }
  for (int i = 0; i < n - 2; i += 2) {
    if (a[i + 1] - 1 == 0)
      printf("%d %d", a[i] * a[i + 1], a[i + 1] - 1);
    else
      printf("%d %d ", a[i] * a[i + 1], a[i + 1] - 1);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1b0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x1a4(%rbp)
mov    -0x1a4(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x1a4(%rbp)
cltq
lea    -0x1a0(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xea3(%rip),%rdi
call   1040 <scanf@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x1,%ecx
mov    %al,-0x1a9(%rbp)
jne    1198 <main+0x78>
mov    -0x1a4(%rbp),%eax
sub    $0x1,%eax
cltq
cmpl   $0x0,-0x1a0(%rbp,%rax,4)
setne  %al
mov    %al,-0x1a9(%rbp)
mov    -0x1a9(%rbp),%al
test   $0x1,%al
jne    11ab <main+0x8b>
jmp    11b0 <main+0x90>
jmp    113c <main+0x1c>
mov    $0x2,%eax
cmp    -0x1a4(%rbp),%eax
jne    11db <main+0xbb>
lea    0xe38(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    12c7 <main+0x1a7>
movl   $0x0,-0x1a8(%rbp)
mov    -0x1a8(%rbp),%eax
mov    -0x1a4(%rbp),%ecx
sub    $0x2,%ecx
cmp    %ecx,%eax
jge    12c0 <main+0x1a0>
mov    -0x1a8(%rbp),%eax
add    $0x1,%eax
cltq
mov    -0x1a0(%rbp,%rax,4),%eax
sub    $0x1,%eax
cmp    $0x0,%eax
jne    1263 <main+0x143>
movslq -0x1a8(%rbp),%rax
mov    -0x1a0(%rbp,%rax,4),%esi
mov    -0x1a8(%rbp),%eax
add    $0x1,%eax
cltq
imul   -0x1a0(%rbp,%rax,4),%esi
ff
mov    -0x1a8(%rbp),%eax
add    $0x1,%eax
cltq
mov    -0x1a0(%rbp,%rax,4),%edx
sub    $0x1,%edx
lea    0xdad(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12a7 <main+0x187>
movslq -0x1a8(%rbp),%rax
mov    -0x1a0(%rbp,%rax,4),%esi
mov    -0x1a8(%rbp),%eax
add    $0x1,%eax
cltq
imul   -0x1a0(%rbp,%rax,4),%esi
ff
mov    -0x1a8(%rbp),%eax
add    $0x1,%eax
cltq
mov    -0x1a0(%rbp,%rax,4),%edx
sub    $0x1,%edx
lea    0xd6a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12ac <main+0x18c>
mov    -0x1a8(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x1a8(%rbp)
jmp    11e5 <main+0xc5>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1b0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x190,%rsp
movabs $0xffffffff00000000,%rax
ff ff ff
mov    %rsp,%rbx
xor    %ecx,%ecx
lea    0xec1(%rip),%r14
movabs $0x100000000,%r13
mov    %rcx,%r12
mov    %rax,%r15
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
cmp    $0x1,%eax
jne    1178 <main+0x58>
lea    -0x1(%r12),%rcx
lea    (%r15,%r13,1),%rax
cmpl   $0x0,(%rbx)
lea    0x4(%rbx),%rbx
jne    1150 <main+0x30>
cmp    $0xffffffff,%r12d
je     11c9 <main+0xa9>
neg    %r12
test   $0xfffffffe,%r12d
je     11d7 <main+0xb7>
sar    $0x20,%r15
lea    0xe6f(%rip),%r14
lea    0xe6e(%rip),%r12
xor    %ebx,%ebx
jmp    11b3 <main+0x93>
mov    %r12,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x2,%rbx
cmp    %r15,%rbx
jge    11d7 <main+0xb7>
mov    0x4(%rsp,%rbx,4),%edx
mov    (%rsp,%rbx,4),%esi
imul   %edx,%esi
add    $0xffffffff,%edx
jne    11a0 <main+0x80>
mov    %r14,%rdi
xor    %edx,%edx
jmp    11a3 <main+0x83>
lea    0xe30(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x190,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"0 0\00"
@.str.2 = [6 x i8] c"%d %d\00"
@.str.3 = [7 x i8] c"%d %d \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i32]
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
br label %5
5: ; preds = %21, %0
%6 = load i32, i32* %3
%7 = add nsw i32 %6, 1
store i32 %7, i32* %3
%8 = sext i32 %6 to i64
%9 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 %8
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %9)
%11 = icmp eq i32 %10, 1
br i1 %11, label %12, label %19
12: ; preds = %5
%13 = load i32, i32* %3
%14 = sub nsw i32 %13, 1
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 %15
%17 = load i32, i32* %16
%18 = icmp ne i32 %17, 0
br label %19
19: ; preds = %12, %5
%20 = phi i1 [ false, %5 ], [ %18, %12 ]
br i1 %20, label %21, label %22
21: ; preds = %19
br label %5
22: ; preds = %19
%23 = load i32, i32* %3
%24 = icmp eq i32 2, %23
br i1 %24, label %25, label %27
25: ; preds = %22
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %1
br label %82
27: ; preds = %22
store i32 0, i32* %4
br label %28
28: ; preds = %78, %27
%29 = load i32, i32* %4
%30 = load i32, i32* %3
%31 = sub nsw i32 %30, 2
%32 = icmp slt i32 %29, %31
br i1 %32, label %33, label %81
33: ; preds = %28
%34 = load i32, i32* %4
%35 = add nsw i32 %34, 1
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 %36
%38 = load i32, i32* %37
%39 = sub nsw i32 %38, 1
%40 = icmp eq i32 %39, 0
br i1 %40, label %41, label %59
41: ; preds = %33
%42 = load i32, i32* %4
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 %43
%45 = load i32, i32* %44
%46 = load i32, i32* %4
%47 = add nsw i32 %46, 1
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 %48
%50 = load i32, i32* %49
%51 = mul nsw i32 %45, %50
%52 = load i32, i32* %4
%53 = add nsw i32 %52, 1
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 %54
%56 = load i32, i32* %55
%57 = sub nsw i32 %56, 1
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %51, i32 %57)
br label %77
59: ; preds = %33
%60 = load i32, i32* %4
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 %61
%63 = load i32, i32* %62
%64 = load i32, i32* %4
%65 = add nsw i32 %64, 1
%66 = sext i32 %65 to i64
%67 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 %66
%68 = load i32, i32* %67
%69 = mul nsw i32 %63, %68
%70 = load i32, i32* %4
%71 = add nsw i32 %70, 1
%72 = sext i32 %71 to i64
%73 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 %72
%74 = load i32, i32* %73
%75 = sub nsw i32 %74, 1
%76 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 %69, i32 %75)
br label %77
77: ; preds = %59, %41
br label %78
78: ; preds = %77
%79 = load i32, i32* %4
%80 = add nsw i32 %79, 2
store i32 %80, i32* %4
br label %28
81: ; preds = %28
store i32 0, i32* %1
br label %82
82: ; preds = %81, %25
%83 = load i32, i32* %1
ret i32 %83
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"0 0\00"
@.str.2 = [6 x i8] c"%d %d\00"
@.str.3 = [7 x i8] c"%d %d \00"
define i32 @main() {
%1 = alloca [100 x i32]
%2 = bitcast [100 x i32]* %1 to i8*
br label %3
3: ; preds = %9, %0
%4 = phi i64 [ %5, %9 ], [ 0, %0 ]
%5 = add nuw i64 %4, 1
%6 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 %4
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %6)
%8 = icmp eq i32 %7, 1
br i1 %8, label %9, label %12
9: ; preds = %3
%10 = load i32, i32* %6
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %3
12: ; preds = %3, %9
%13 = trunc i64 %5 to i32
%14 = icmp eq i32 %13, 2
br i1 %14, label %22, label %15
15: ; preds = %12
%16 = and i64 %4, 4294967294
%17 = icmp eq i64 %16, 0
br i1 %17, label %41, label %18
18: ; preds = %15
%19 = shl i64 %4, 32
%20 = add i64 %19, -4294967296
%21 = ashr exact i64 %20, 32
br label %24
22: ; preds = %12
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %41
24: ; preds = %18, %38
%25 = phi i64 [ 0, %18 ], [ %39, %38 ]
%26 = or i64 %25, 1
%27 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 %26
%28 = load i32, i32* %27
%29 = add nsw i32 %28, -1
%30 = icmp eq i32 %29, 0
%31 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 %25
%32 = load i32, i32* %31
%33 = mul nsw i32 %32, %28
br i1 %30, label %34, label %36
34: ; preds = %24
%35 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %33, i32 0)
br label %38
36: ; preds = %24
%37 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 %33, i32 %29)
br label %38
38: ; preds = %34, %36
%39 = add nuw nsw i64 %25, 2
%40 = icmp slt i64 %39, %21
br i1 %40, label %24, label %41
41: ; preds = %38, %15, %22
ret i32 0
}