#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 /*<<< orphan*/ store;

/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ close(int);
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ read(int, char *, int);
char *strstr(char *, char *);
void getInforAftSpace(char *path, char *name, char infor[]) {
  int fd = open(path, O_RDONLY);
  char store[2000];
  int k = 0;
  char *p = NULL;
  read(fd, store, sizeof(store));
  close(fd);
  p = strstr(store, name);
  while ((*p < '0') || (*p > '9')) {
    p++;
  }
  while ((*p >= '0') && (*p <= '9')) {
    infor[k] = *p;
    k++;
    p++;
  }
  infor[k] = '\0';
}


x86 assembly (clang, -O0):
<getInforAftSpace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x810,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e86(%rip),%rax
mov    (%rax),%esi
call   1050 <open@plt>
mov    %eax,-0x1c(%rbp)
movl   $0x0,-0x7f4(%rbp)
movq   $0x0,-0x800(%rbp)
mov    -0x1c(%rbp),%edi
lea    -0x7f0(%rbp),%rsi
mov    $0x7d0,%edx
call   1040 <read@plt>
mov    -0x1c(%rbp),%edi
call   1030 <close@plt>
lea    -0x7f0(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1060 <strstr@plt>
mov    %rax,-0x800(%rbp)
mov    -0x800(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x30,%ecx
mov    %al,-0x801(%rbp)
jl     11e5 <getInforAftSpace+0xa5>
mov    -0x800(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x39,%eax
setg   %al
mov    %al,-0x801(%rbp)
mov    -0x801(%rbp),%al
test   $0x1,%al
jne    11f8 <getInforAftSpace+0xb8>
jmp    120f <getInforAftSpace+0xcf>
mov    -0x800(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x800(%rbp)
jmp    11b4 <getInforAftSpace+0x74>
jmp    1214 <getInforAftSpace+0xd4>
mov    -0x800(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x802(%rbp)
jl     1245 <getInforAftSpace+0x105>
mov    -0x800(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x802(%rbp)
mov    -0x802(%rbp),%al
test   $0x1,%al
jne    1258 <getInforAftSpace+0x118>
jmp    1295 <getInforAftSpace+0x155>
mov    -0x800(%rbp),%rax
mov    (%rax),%dl
mov    -0x18(%rbp),%rax
movslq -0x7f4(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x7f4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x7f4(%rbp)
mov    -0x800(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x800(%rbp)
jmp    1214 <getInforAftSpace+0xd4>
mov    -0x18(%rbp),%rax
movslq -0x7f4(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x810,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getInforAftSpace>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x7d8,%rsp
mov    %rdx,%rbx
mov    %rsi,%r14
mov    0x2e8e(%rip),%rax
mov    (%rax),%esi
call   1050 <open@plt>
mov    %eax,%ebp
mov    %rsp,%r15
mov    %eax,%edi
mov    %r15,%rsi
mov    $0x7d0,%edx
call   1040 <read@plt>
mov    %ebp,%edi
call   1030 <close@plt>
mov    %r15,%rdi
mov    %r14,%rsi
call   1060 <strstr@plt>
nopw   0x0(%rax,%rax,1)
movzbl (%rax),%ecx
lea    -0x3a(%rcx),%edx
add    $0x1,%rax
cmp    $0xf6,%dl
jb     1190 <getInforAftSpace+0x50>
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %cl,(%rbx,%rdx,1)
movzbl (%rax,%rdx,1),%ecx
add    $0x1,%rdx
lea    -0x30(%rcx),%esi
cmp    $0xa,%sil
jb     11b0 <getInforAftSpace+0x70>
mov    %edx,%eax
movb   $0x0,(%rbx,%rax,1)
add    $0x7d8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@O_RDONLY = global i32 0
define void @getInforAftSpace(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca [2000 x i8]
%9 = alloca i32
%10 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%11 = load i8*, i8** %4
%12 = load i32, i32* @O_RDONLY
%13 = call i32 @open(i8* %11, i32 %12)
store i32 %13, i32* %7
store i32 0, i32* %9
store i8* null, i8** %10
%14 = load i32, i32* %7
%15 = getelementptr inbounds [2000 x i8], [2000 x i8]* %8, i64 0, i64 0
%16 = call i32 @read(i32 %14, i8* %15, i32 2000)
%17 = load i32, i32* %7
%18 = call i32 @close(i32 %17)
%19 = getelementptr inbounds [2000 x i8], [2000 x i8]* %8, i64 0, i64 0
%20 = load i8*, i8** %5
%21 = call i8* @strstr(i8* %19, i8* %20)
store i8* %21, i8** %10
br label %22
22: ; preds = %34, %3
%23 = load i8*, i8** %10
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = icmp slt i32 %25, 48
br i1 %26, label %32, label %27
27: ; preds = %22
%28 = load i8*, i8** %10
%29 = load i8, i8* %28
%30 = sext i8 %29 to i32
%31 = icmp sgt i32 %30, 57
br label %32
32: ; preds = %27, %22
%33 = phi i1 [ true, %22 ], [ %31, %27 ]
br i1 %33, label %34, label %37
34: ; preds = %32
%35 = load i8*, i8** %10
%36 = getelementptr inbounds i8, i8* %35, i32 1
store i8* %36, i8** %10
br label %22
37: ; preds = %32
br label %38
38: ; preds = %50, %37
%39 = load i8*, i8** %10
%40 = load i8, i8* %39
%41 = sext i8 %40 to i32
%42 = icmp sge i32 %41, 48
br i1 %42, label %43, label %48
43: ; preds = %38
%44 = load i8*, i8** %10
%45 = load i8, i8* %44
%46 = sext i8 %45 to i32
%47 = icmp sle i32 %46, 57
br label %48
48: ; preds = %43, %38
%49 = phi i1 [ false, %38 ], [ %47, %43 ]
br i1 %49, label %50, label %61
50: ; preds = %48
%51 = load i8*, i8** %10
%52 = load i8, i8* %51
%53 = load i8*, i8** %6
%54 = load i32, i32* %9
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds i8, i8* %53, i64 %55
store i8 %52, i8* %56
%57 = load i32, i32* %9
%58 = add nsw i32 %57, 1
store i32 %58, i32* %9
%59 = load i8*, i8** %10
%60 = getelementptr inbounds i8, i8* %59, i32 1
store i8* %60, i8** %10
br label %38
61: ; preds = %48
%62 = load i8*, i8** %6
%63 = load i32, i32* %9
%64 = sext i32 %63 to i64
%65 = getelementptr inbounds i8, i8* %62, i64 %64
store i8 0, i8* %65
ret void
}

LLVM IR (-O2):
@O_RDONLY = global i32 0
define void @getInforAftSpace(i8* nocapture %0, i8* nocapture %1, i8* nocapture writeonly %2) {
%4 = alloca [2000 x i8]
%5 = load i32, i32* @O_RDONLY
%6 = tail call i32 @open(i8* %0, i32 %5)
%7 = getelementptr inbounds [2000 x i8], [2000 x i8]* %4, i64 0, i64 0
%8 = call i32 @read(i32 %6, i8* %7, i32 2000)
%9 = tail call i32 @close(i32 %6)
%10 = call i8* @strstr(i8* %7, i8* dereferenceable(1) %1)
br label %11
11: ; preds = %11, %3
%12 = phi i8* [ %10, %3 ], [ %16, %11 ]
%13 = load i8, i8* %12
%14 = add i8 %13, -58
%15 = icmp ult i8 %14, -10
%16 = getelementptr inbounds i8, i8* %12, i64 1
br i1 %15, label %11, label %17
17: ; preds = %11, %17
%18 = phi i64 [ %22, %17 ], [ 0, %11 ]
%19 = phi i8 [ %24, %17 ], [ %13, %11 ]
%20 = phi i8* [ %23, %17 ], [ %12, %11 ]
%21 = getelementptr inbounds i8, i8* %2, i64 %18
store i8 %19, i8* %21
%22 = add nuw i64 %18, 1
%23 = getelementptr inbounds i8, i8* %20, i64 1
%24 = load i8, i8* %23
%25 = add i8 %24, -48
%26 = icmp ult i8 %25, 10
br i1 %26, label %17, label %27
27: ; preds = %17
%28 = and i64 %22, 4294967295
%29 = getelementptr inbounds i8, i8* %2, i64 %28
store i8 0, i8* %29
ret void
}