#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 validador(int);
int main() {
  int n = 0;
  int l = 0;
  int c = 0;
  int i = 0;
  int breaks = 0;
  scanf("%d", &n);
  if (n >= 1 && n <= 100) {
    for (i = 0; i < n; i++) {
      scanf("%d", &l);
      if (validador(l) != 1)
        return 0;
      scanf("%d", &c);
      if (validador(c) != 1)
        return 0;
      if (l > c) {
        breaks = breaks + c;
      }
    }
  }
  printf("%d", breaks);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
lea    0xe97(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
cmpl   $0x1,-0x8(%rbp)
jl     1220 <main+0xf0>
cmpl   $0x64,-0x8(%rbp)
jg     1220 <main+0xf0>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    121b <main+0xeb>
lea    0xe60(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0xc(%rbp),%edi
call   1040 <validador@plt>
cmp    $0x1,%eax
je     11c6 <main+0x96>
movl   $0x0,-0x4(%rbp)
jmp    122f <main+0xff>
lea    0xe33(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x10(%rbp),%edi
call   1040 <validador@plt>
cmp    $0x1,%eax
je     11f3 <main+0xc3>
movl   $0x0,-0x4(%rbp)
jmp    122f <main+0xff>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    1208 <main+0xd8>
mov    -0x18(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    120d <main+0xdd>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    118d <main+0x5d>
jmp    1220 <main+0xf0>
mov    -0x18(%rbp),%esi
lea    0xdd6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
movl   $0x0,0x14(%rsp)
movl   $0x0,0x10(%rsp)
movl   $0x0,0xc(%rsp)
lea    0xea3(%rip),%rdi
lea    0x14(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x14(%rsp),%eax
add    $0xffffffff,%eax
xor    %ebx,%ebx
cmp    $0x63,%eax
ja     11d9 <main+0xa9>
xor    %r13d,%r13d
lea    0xe81(%rip),%r14
lea    0x10(%rsp),%r15
lea    0xc(%rsp),%r12
xor    %ebx,%ebx
xor    %ebp,%ebp
nopl   (%rax)
mov    %r14,%rdi
mov    %r15,%rsi
call   1050 <scanf@plt>
mov    0x10(%rsp),%edi
call   1040 <validador@plt>
cmp    $0x1,%eax
jne    11e7 <main+0xb7>
mov    %r14,%rdi
mov    %r12,%rsi
call   1050 <scanf@plt>
mov    0xc(%rsp),%edi
call   1040 <validador@plt>
cmp    $0x1,%eax
jne    11e7 <main+0xb7>
mov    0xc(%rsp),%eax
cmp    %eax,0x10(%rsp)
cmovle %r13d,%eax
add    %eax,%ebx
add    $0x1,%ebp
cmp    0x14(%rsp),%ebp
jl     1190 <main+0x60>
lea    0xe20(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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