#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 */
scalar_t__ EOF;
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ scanf(char *, int *, int *);
int main() {
  int v, t;
  while (scanf("%d%d", &v, &t) != EOF) {
    if (t != 0) {
      printf("%d\n", 2 * v * t);
    } else {
      printf("0\n");
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    0x2e9e(%rip),%rcx
cmp    (%rcx),%rax
je     118d <main+0x6d>
cmpl   $0x0,-0xc(%rbp)
je     117a <main+0x5a>
mov    -0x8(%rbp),%esi
shl    $0x1,%esi
imul   -0xc(%rbp),%esi
lea    0xe97(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1188 <main+0x68>
lea    0xe88(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xebe(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1050 <scanf@plt>
mov    0x2e92(%rip),%rbp
cmp    0x0(%rbp),%rax
jne    116d <main+0x3d>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xe95(%rip),%r14
lea    0xe85(%rip),%r15
lea    0x4(%rsp),%r12
mov    %rsp,%rbx
lea    0xe7b(%rip),%r13
jmp    11ac <main+0x7c>
nopl   0x0(%rax)
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
call   1050 <scanf@plt>
cmp    0x0(%rbp),%rax
je     115c <main+0x2c>
mov    (%rsp),%esi
test   %esi,%esi
je     1190 <main+0x60>
imul   0x4(%rsp),%esi
add    %esi,%esi
mov    %r13,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1198 <main+0x68>

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

LLVM IR (-O2):
@.str = [5 x i8] c"%d%d\00"
@EOF = global i64 0
@.str.1 = [4 x i8] c"%d\0A\00"
@str = [2 x i8] c"0\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i64 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i64, i64* @EOF
%7 = icmp eq i64 %5, %6
br i1 %7, label %22, label %8
8: ; preds = %0, %18
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 0
br i1 %10, label %16, label %11
11: ; preds = %8
%12 = load i32, i32* %1
%13 = shl i32 %9, 1
%14 = mul i32 %13, %12
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %14)
br label %18
16: ; preds = %8
%17 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
br label %18
18: ; preds = %16, %11
%19 = call i64 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%20 = load i64, i64* @EOF
%21 = icmp eq i64 %19, %20
br i1 %21, label %22, label %8
22: ; preds = %18, %0
ret i32 0
}