#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 getInforNotd(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);
  do {
    p++;
  } while (*p != ':');
  p += 2;
  while (*p != '\n') {
    infor[k] = *p;
    k++;
    p++;
  }
  infor[k] = '\0';
}


x86 assembly (clang, -O0):
<getInforNotd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x800,%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
add    $0x1,%rax
mov    %rax,-0x800(%rbp)
mov    -0x800(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3a,%eax
jne    11b4 <getInforNotd+0x74>
mov    -0x800(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x800(%rbp)
mov    -0x800(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
je     123b <getInforNotd+0xfb>
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    11eb <getInforNotd+0xab>
mov    -0x18(%rbp),%rax
movslq -0x7f4(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x800,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getInforNotd>:
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>
add    $0x3,%rax
nopl   0x0(%rax,%rax,1)
cmpb   $0x3a,-0x2(%rax)
lea    0x1(%rax),%rax
jne    1190 <getInforNotd+0x50>
mov    -0x1(%rax),%cl
cmp    $0xa,%cl
jne    11a6 <getInforNotd+0x66>
xor    %eax,%eax
jmp    11c2 <getInforNotd+0x82>
xor    %edx,%edx
nopl   0x0(%rax,%rax,1)
mov    %cl,(%rbx,%rdx,1)
movzbl (%rax,%rdx,1),%ecx
add    $0x1,%rdx
cmp    $0xa,%cl
jne    11b0 <getInforNotd+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 @getInforNotd(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 = %25, %3
%23 = load i8*, i8** %10
%24 = getelementptr inbounds i8, i8* %23, i32 1
store i8* %24, i8** %10
br label %25
25: ; preds = %22
%26 = load i8*, i8** %10
%27 = load i8, i8* %26
%28 = sext i8 %27 to i32
%29 = icmp ne i32 %28, 58
br i1 %29, label %22, label %30
30: ; preds = %25
%31 = load i8*, i8** %10
%32 = getelementptr inbounds i8, i8* %31, i64 2
store i8* %32, i8** %10
br label %33
33: ; preds = %38, %30
%34 = load i8*, i8** %10
%35 = load i8, i8* %34
%36 = sext i8 %35 to i32
%37 = icmp ne i32 %36, 10
br i1 %37, label %38, label %49
38: ; preds = %33
%39 = load i8*, i8** %10
%40 = load i8, i8* %39
%41 = load i8*, i8** %6
%42 = load i32, i32* %9
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds i8, i8* %41, i64 %43
store i8 %40, i8* %44
%45 = load i32, i32* %9
%46 = add nsw i32 %45, 1
store i32 %46, i32* %9
%47 = load i8*, i8** %10
%48 = getelementptr inbounds i8, i8* %47, i32 1
store i8* %48, i8** %10
br label %33
49: ; preds = %33
%50 = load i8*, i8** %6
%51 = load i32, i32* %9
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds i8, i8* %50, i64 %52
store i8 0, i8* %53
ret void
}

LLVM IR (-O2):
@O_RDONLY = global i32 0
define void @getInforNotd(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 ], [ %13, %11 ]
%13 = getelementptr inbounds i8, i8* %12, i64 1
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 58
br i1 %15, label %16, label %11
16: ; preds = %11
%17 = getelementptr inbounds i8, i8* %12, i64 3
%18 = load i8, i8* %17
%19 = icmp eq i8 %18, 10
br i1 %19, label %31, label %20
20: ; preds = %16, %20
%21 = phi i64 [ %25, %20 ], [ 0, %16 ]
%22 = phi i8 [ %27, %20 ], [ %18, %16 ]
%23 = phi i8* [ %26, %20 ], [ %17, %16 ]
%24 = getelementptr inbounds i8, i8* %2, i64 %21
store i8 %22, i8* %24
%25 = add nuw i64 %21, 1
%26 = getelementptr inbounds i8, i8* %23, i64 1
%27 = load i8, i8* %26
%28 = icmp eq i8 %27, 10
br i1 %28, label %29, label %20
29: ; preds = %20
%30 = and i64 %25, 4294967295
br label %31
31: ; preds = %29, %16
%32 = phi i64 [ 0, %16 ], [ %30, %29 ]
%33 = getelementptr inbounds i8, i8* %2, i64 %32
store i8 0, i8* %33
ret void
}