#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 nrand(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ srandom(int);
int main() {
  int s;
  int n;
  scanf("%d", &s);
  srandom(s);
  scanf("%d", &n);
  int i = 0;
  unsigned int x;
  unsigned int y;
  int k = 0;
  while (i++ < n) {
    x = 5000 - nrand(10000);
    y = 5000 - nrand(10000);
    if (x * x + y * y < 25000000)
      k++;
  }
  printf("%d;", k);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1060 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1040 <srandom@plt>
lea    0xe92(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1060 <scanf@plt>
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x10(%rbp)
cmp    -0xc(%rbp),%eax
jge    11ee <main+0xae>
mov    $0x2710,%edi
call   1030 <nrand@plt>
mov    %eax,%ecx
mov    $0x1388,%eax
sub    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    $0x2710,%edi
call   1030 <nrand@plt>
mov    %eax,%ecx
mov    $0x1388,%eax
sub    %ecx,%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
imul   -0x14(%rbp),%eax
mov    -0x18(%rbp),%ecx
imul   -0x18(%rbp),%ecx
add    %ecx,%eax
cmp    $0x17d7840,%eax
jae    11e9 <main+0xa9>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1185 <main+0x45>
mov    -0x1c(%rbp),%esi
lea    0xe0b(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xeb1(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
mov    0xc(%rsp),%edi
call   1040 <srandom@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
cmpl   $0x0,0x8(%rsp)
jle    11bf <main+0x7f>
xor    %r14d,%r14d
xor    %ebp,%ebp
xchg   %ax,%ax
add    $0x1,%ebp
mov    $0x2710,%edi
call   1030 <nrand@plt>
mov    $0x1388,%ebx
sub    %eax,%ebx
mov    $0x2710,%edi
call   1030 <nrand@plt>
mov    $0x1388,%ecx
sub    %eax,%ecx
imul   %ebx,%ebx
imul   %ecx,%ecx
add    %ebx,%ecx
cmp    $0x17d7840,%ecx
adc    $0x0,%r14d
cmp    0x8(%rsp),%ebp
jl     1180 <main+0x40>
jmp    11c2 <main+0x82>
xor    %r14d,%r14d
lea    0xe3a(%rip),%rdi
mov    %r14d,%esi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 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
%7 = alloca i32
store i32 0, i32* %1
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%9 = load i32, i32* %2
%10 = call i32 @srandom(i32 %9)
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
store i32 0, i32* %4
store i32 0, i32* %7
br label %12
12: ; preds = %33, %0
%13 = load i32, i32* %4
%14 = add nsw i32 %13, 1
store i32 %14, i32* %4
%15 = load i32, i32* %3
%16 = icmp slt i32 %13, %15
br i1 %16, label %17, label %34
17: ; preds = %12
%18 = call i32 @nrand(i32 10000)
%19 = sub nsw i32 5000, %18
store i32 %19, i32* %5
%20 = call i32 @nrand(i32 10000)
%21 = sub nsw i32 5000, %20
store i32 %21, i32* %6
%22 = load i32, i32* %5
%23 = load i32, i32* %5
%24 = mul i32 %22, %23
%25 = load i32, i32* %6
%26 = load i32, i32* %6
%27 = mul i32 %25, %26
%28 = add i32 %24, %27
%29 = icmp ult i32 %28, 25000000
br i1 %29, label %30, label %33
30: ; preds = %17
%31 = load i32, i32* %7
%32 = add nsw i32 %31, 1
store i32 %32, i32* %7
br label %33
33: ; preds = %30, %17
br label %12
34: ; preds = %12
%35 = load i32, i32* %7
%36 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %35)
ret i32 0
}

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