#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 *, int);
scalar_t__ scanf(char *, int *);
int main(int argc, const char *argv[]) {
  int prev = 40000, now, cnt = 0;
  while (scanf("%d", &now) != EOF) {
    if (now <= prev) {
      prev = now;
      cnt++;
    }
  }
  printf("%d\n", cnt);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x9c40,-0x14(%rbp)
movl   $0x0,-0x1c(%rbp)
lea    0xeb5(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <scanf@plt>
mov    0x2e8d(%rip),%rcx
cmp    (%rcx),%rax
je     1184 <main+0x64>
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jg     117f <main+0x5f>
mov    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1144 <main+0x24>
mov    -0x1c(%rbp),%esi
lea    0xe75(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
lea    0xecd(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x2ea4(%rip),%r12
xor    %ebx,%ebx
cmp    (%r12),%rax
je     1181 <main+0x61>
mov    $0x9c40,%ebp
xor    %ebx,%ebx
lea    0xea6(%rip),%r14
lea    0xc(%rsp),%r15
nop
mov    0xc(%rsp),%eax
xor    %ecx,%ecx
cmp    %ebp,%eax
setle  %cl
cmovle %eax,%ebp
add    %ecx,%ebx
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <scanf@plt>
cmp    (%r12),%rax
jne    1160 <main+0x40>
lea    0xe7b(%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"
@EOF = global i64 0
@.str.1 = [4 x i8] c"%d\0A\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
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 40000, i32* %6
store i32 0, i32* %8
br label %9
9: ; preds = %21, %2
%10 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %7)
%11 = load i64, i64* @EOF
%12 = icmp ne i64 %10, %11
br i1 %12, label %13, label %22
13: ; preds = %9
%14 = load i32, i32* %7
%15 = load i32, i32* %6
%16 = icmp sle i32 %14, %15
br i1 %16, label %17, label %21
17: ; preds = %13
%18 = load i32, i32* %7
store i32 %18, i32* %6
%19 = load i32, i32* %8
%20 = add nsw i32 %19, 1
store i32 %20, i32* %8
br label %21
21: ; preds = %17, %13
br label %9
22: ; preds = %9
%23 = load i32, i32* %8
%24 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %23)
ret i32 0
}

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