#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);
int /*<<< orphan*/ scanf(char *, int *);
int main(int argc, char const *argv[]) {
  int n = 0;
  int t = 0;
  int v = 0;
  int d = 0;
  int Sd = 0;
  scanf("%d", &n);
  if (n >= 1 && n <= 1000) {
    for (int i = 0; i < n; ++i) {
      scanf("%d", &t);
      if (t <= 1 && t >= 100) {
        return 0;
      }
      scanf("%d", &v);
      if (v <= 0 && v >= 120) {
        return 0;
      }
      d = t * v;
      Sd = Sd + d;
    }
  }
  printf("%d", Sd);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
lea    0xea0(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x1,-0x14(%rbp)
jl     1219 <main+0xf9>
cmpl   $0x3e8,-0x14(%rbp)
jg     1219 <main+0xf9>
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1214 <main+0xf4>
lea    0xe66(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x1,-0x18(%rbp)
jg     11c3 <main+0xa3>
cmpl   $0x64,-0x18(%rbp)
jl     11c3 <main+0xa3>
movl   $0x0,-0x4(%rbp)
jmp    122f <main+0x10f>
lea    0xe36(%rip),%rdi
lea    -0x1c(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,-0x1c(%rbp)
jg     11f3 <main+0xd3>
cmpl   $0x78,-0x1c(%rbp)
jl     11f3 <main+0xd3>
movl   $0x0,-0x4(%rbp)
jmp    122f <main+0x10f>
mov    -0x18(%rbp),%eax
imul   -0x1c(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x24(%rbp),%eax
add    -0x20(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1187 <main+0x67>
jmp    1219 <main+0xf9>
mov    -0x24(%rbp),%esi
lea    0xddd(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0x4(%rsp)
movl   $0x0,0xc(%rsp)
movl   $0x0,0x8(%rsp)
lea    0xeb5(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
add    $0xffffffff,%eax
xor    %ebx,%ebx
cmp    $0x3e7,%eax
ja     11aa <main+0x8a>
xor    %ebp,%ebp
lea    0xe92(%rip),%r14
lea    0xc(%rsp),%r15
lea    0x8(%rsp),%r12
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <scanf@plt>
mov    %r14,%rdi
mov    %r12,%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%eax
imul   0x8(%rsp),%eax
add    %eax,%ebx
add    $0x1,%ebp
cmp    0x4(%rsp),%ebp
jl     1180 <main+0x60>
lea    0xe4f(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
store i32 0, i32* %7
store i32 0, i32* %8
store i32 0, i32* %9
store i32 0, i32* %10
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %6)
%13 = load i32, i32* %6
%14 = icmp sge i32 %13, 1
br i1 %14, label %15, label %50
15: ; preds = %2
%16 = load i32, i32* %6
%17 = icmp sle i32 %16, 1000
br i1 %17, label %18, label %50
18: ; preds = %15
store i32 0, i32* %11
br label %19
19: ; preds = %46, %18
%20 = load i32, i32* %11
%21 = load i32, i32* %6
%22 = icmp slt i32 %20, %21
br i1 %22, label %23, label %49
23: ; preds = %19
%24 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %7)
%25 = load i32, i32* %7
%26 = icmp sle i32 %25, 1
br i1 %26, label %27, label %31
27: ; preds = %23
%28 = load i32, i32* %7
%29 = icmp sge i32 %28, 100
br i1 %29, label %30, label %31
30: ; preds = %27
store i32 0, i32* %3
br label %53
31: ; preds = %27, %23
%32 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %8)
%33 = load i32, i32* %8
%34 = icmp sle i32 %33, 0
br i1 %34, label %35, label %39
35: ; preds = %31
%36 = load i32, i32* %8
%37 = icmp sge i32 %36, 120
br i1 %37, label %38, label %39
38: ; preds = %35
store i32 0, i32* %3
br label %53
39: ; preds = %35, %31
%40 = load i32, i32* %7
%41 = load i32, i32* %8
%42 = mul nsw i32 %40, %41
store i32 %42, i32* %9
%43 = load i32, i32* %10
%44 = load i32, i32* %9
%45 = add nsw i32 %43, %44
store i32 %45, i32* %10
br label %46
46: ; preds = %39
%47 = load i32, i32* %11
%48 = add nsw i32 %47, 1
store i32 %48, i32* %11
br label %19
49: ; preds = %19
br label %50
50: ; preds = %49, %15, %2
%51 = load i32, i32* %10
%52 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %51)
store i32 0, i32* %3
br label %53
53: ; preds = %50, %38, %30
%54 = load i32, i32* %3
ret i32 %54
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%7 = bitcast i32* %4 to i8*
store i32 0, i32* %4
%8 = bitcast i32* %5 to i8*
store i32 0, i32* %5
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%10 = load i32, i32* %3
%11 = add i32 %10, -1
%12 = icmp ult i32 %11, 1000
br i1 %12, label %13, label %25
13: ; preds = %2, %13
%14 = phi i32 [ %22, %13 ], [ 0, %2 ]
%15 = phi i32 [ %21, %13 ], [ 0, %2 ]
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %4)
%17 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %5)
%18 = load i32, i32* %5
%19 = load i32, i32* %4
%20 = mul nsw i32 %19, %18
%21 = add nsw i32 %20, %15
%22 = add nuw nsw i32 %14, 1
%23 = load i32, i32* %3
%24 = icmp slt i32 %22, %23
br i1 %24, label %13, label %25
25: ; preds = %13, %2
%26 = phi i32 [ 0, %2 ], [ %21, %13 ]
%27 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %26)
ret i32 0
}