#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 */
typedef int uint;

/* Variables and functions */
int check_pfd(int, int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(int argc, char **argv) {
  srand(time(NULL));
  uint i = 28;
  int err;
  err = check_pfd(1, 28);
  if (err) {
    printf("\n s9 check failed!, please check");
    exit(0);
  }
  err = check_pfd(1000, i);
  if (err) {
    printf("\n s9 check failed!, please check");
    exit(0);
  }
  err = check_pfd(10000000, i);
  if (err) {
    printf("\n s9 check failed!, please check");
    exit(0);
  }
  err = check_pfd(100000000, i);
  if (err) {
    printf("\n s9 check failed!, please check");
    exit(0);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
movl   $0x1c,-0x14(%rbp)
mov    $0x1,%edi
mov    $0x1c,%esi
call   1060 <check_pfd@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
je     11a5 <main+0x55>
lea    0xe67(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1070 <exit@plt>
mov    -0x14(%rbp),%esi
mov    $0x3e8,%edi
call   1060 <check_pfd@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
je     11d2 <main+0x82>
lea    0xe3a(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1070 <exit@plt>
mov    -0x14(%rbp),%esi
mov    $0x989680,%edi
call   1060 <check_pfd@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
je     11ff <main+0xaf>
lea    0xe0d(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1070 <exit@plt>
mov    -0x14(%rbp),%esi
mov    $0x5f5e100,%edi
call   1060 <check_pfd@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
je     122c <main+0xdc>
lea    0xde0(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1070 <exit@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
mov    $0x1,%edi
mov    $0x1c,%esi
call   1060 <check_pfd@plt>
test   %eax,%eax
jne    11af <main+0x5f>
mov    $0x3e8,%edi
mov    $0x1c,%esi
call   1060 <check_pfd@plt>
test   %eax,%eax
jne    11af <main+0x5f>
mov    $0x989680,%edi
mov    $0x1c,%esi
call   1060 <check_pfd@plt>
test   %eax,%eax
jne    11af <main+0x5f>
mov    $0x5f5e100,%edi
mov    $0x1c,%esi
call   1060 <check_pfd@plt>
test   %eax,%eax
jne    11af <main+0x5f>
xor    %eax,%eax
pop    %rcx
ret
lea    0xe4a(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"\0A s9 check failed!, please check\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
%7 = call i32 @time(i32* null)
%8 = call i32 @srand(i32 %7)
store i32 28, i32* %5
%9 = call i32 @check_pfd(i32 1, i32 28)
store i32 %9, i32* %6
%10 = load i32, i32* %6
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %2
%13 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%14 = call i32 @exit(i32 0)
unreachable
15: ; preds = %2
%16 = load i32, i32* %5
%17 = call i32 @check_pfd(i32 1000, i32 %16)
store i32 %17, i32* %6
%18 = load i32, i32* %6
%19 = icmp ne i32 %18, 0
br i1 %19, label %20, label %23
20: ; preds = %15
%21 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%22 = call i32 @exit(i32 0)
unreachable
23: ; preds = %15
%24 = load i32, i32* %5
%25 = call i32 @check_pfd(i32 10000000, i32 %24)
store i32 %25, i32* %6
%26 = load i32, i32* %6
%27 = icmp ne i32 %26, 0
br i1 %27, label %28, label %31
28: ; preds = %23
%29 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%30 = call i32 @exit(i32 0)
unreachable
31: ; preds = %23
%32 = load i32, i32* %5
%33 = call i32 @check_pfd(i32 100000000, i32 %32)
store i32 %33, i32* %6
%34 = load i32, i32* %6
%35 = icmp ne i32 %34, 0
br i1 %35, label %36, label %39
36: ; preds = %31
%37 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%38 = call i32 @exit(i32 0)
unreachable
39: ; preds = %31
ret i32 0
}

LLVM IR (-O2):
@.str = [33 x i8] c"\0A s9 check failed!, please check\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @time(i32* null)
%4 = tail call i32 @srand(i32 %3)
%5 = tail call i32 @check_pfd(i32 1, i32 28)
%6 = icmp eq i32 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 @exit(i32 0)
unreachable
10: ; preds = %2
%11 = tail call i32 @check_pfd(i32 1000, i32 28)
%12 = icmp eq i32 %11, 0
br i1 %12, label %16, label %13
13: ; preds = %10
%14 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%15 = tail call i32 @exit(i32 0)
unreachable
16: ; preds = %10
%17 = tail call i32 @check_pfd(i32 10000000, i32 28)
%18 = icmp eq i32 %17, 0
br i1 %18, label %22, label %19
19: ; preds = %16
%20 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%21 = tail call i32 @exit(i32 0)
unreachable
22: ; preds = %16
%23 = tail call i32 @check_pfd(i32 100000000, i32 28)
%24 = icmp eq i32 %23, 0
br i1 %24, label %28, label %25
25: ; preds = %22
%26 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%27 = tail call i32 @exit(i32 0)
unreachable
28: ; preds = %22
ret i32 0
}