#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 questions, max_difficulty, difficulty, count, skip;
  count = skip = 0;
  scanf("%d %d", &questions, &max_difficulty);
  printf("%d %d\n", questions, max_difficulty);
  for (int i = 0; i < questions && skip < 2; i++) {
    scanf("%d", &difficulty);
    if (difficulty < max_difficulty)
      ++count;
    else
      ++skip;
  }
  printf("%d\n", count);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x14(%rbp)
lea    0xebc(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xea6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%ecx
xor    %eax,%eax
cmp    -0x8(%rbp),%ecx
mov    %al,-0x1d(%rbp)
jge    1189 <main+0x69>
cmpl   $0x2,-0x18(%rbp)
setl   %al
mov    %al,-0x1d(%rbp)
mov    -0x1d(%rbp),%al
test   $0x1,%al
jne    1199 <main+0x79>
jmp    11e1 <main+0xc1>
lea    0xe63(%rip),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11c5 <main+0xa5>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11ce <main+0xae>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11d3 <main+0xb3>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    116e <main+0x4e>
mov    -0x14(%rbp),%esi
lea    0xe1e(%rip),%rdi
mov    $0x0,%al
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   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xecb(%rip),%rdi
xor    %ebx,%ebx
lea    0xc(%rsp),%rsi
lea    0x10(%rsp),%rdx
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0xc(%rsp),%esi
mov    0x10(%rsp),%edx
lea    0xeaf(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
cmpl   $0x0,0xc(%rsp)
jle    11b9 <main+0x99>
mov    $0x1,%r12d
lea    0xe91(%rip),%r14
lea    0x14(%rsp),%r15
xor    %ebp,%ebp
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    %ebx,%r13d
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0x14(%rsp),%ecx
xor    %eax,%eax
xor    %ebx,%ebx
cmp    0x10(%rsp),%ecx
setge  %cl
setl   %bl
add    %r13d,%ebx
cmp    0xc(%rsp),%r12d
jge    11b9 <main+0x99>
mov    %cl,%al
add    %eax,%ebp
add    $0x1,%r12d
cmp    $0x2,%ebp
jb     1180 <main+0x60>
lea    0xe49(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
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 = [6 x i8] c"%d %d\00"
@.str.1 = [7 x i8] c"%d %d\0A\00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %6
store i32 0, i32* %5
%8 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %9, i32 %10)
store i32 0, i32* %7
br label %12
12: ; preds = %33, %0
%13 = load i32, i32* %7
%14 = load i32, i32* %2
%15 = icmp slt i32 %13, %14
br i1 %15, label %16, label %19
16: ; preds = %12
%17 = load i32, i32* %6
%18 = icmp slt i32 %17, 2
br label %19
19: ; preds = %16, %12
%20 = phi i1 [ false, %12 ], [ %18, %16 ]
br i1 %20, label %21, label %36
21: ; preds = %19
%22 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %4)
%23 = load i32, i32* %4
%24 = load i32, i32* %3
%25 = icmp slt i32 %23, %24
br i1 %25, label %26, label %29
26: ; preds = %21
%27 = load i32, i32* %5
%28 = add nsw i32 %27, 1
store i32 %28, i32* %5
br label %32
29: ; preds = %21
%30 = load i32, i32* %6
%31 = add nsw i32 %30, 1
store i32 %31, i32* %6
br label %32
32: ; preds = %29, %26
br label %33
33: ; preds = %32
%34 = load i32, i32* %7
%35 = add nsw i32 %34, 1
store i32 %35, i32* %7
br label %12
36: ; preds = %19
%37 = load i32, i32* %5
%38 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %37)
ret i32 0
}

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