#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*/ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
void read_info(char store[], int i, char get[]) {
  int j = 0;
  int k = 0;
  int cflags = 0;
  char buf[20];
  while (cflags < i - 1) {
    if (store[j++] == ' ')
      cflags++;
  }
  while (store[j] != ' ') {
    buf[k++] = store[j];
    j++;
  }
  buf[k] = '\0';
  if (2 == i) {
    int i, j = 0;
    for (i = 1; ')' != buf[i]; i++) {
      get[j++] = buf[i];
    }
    get[j] = '\0';
  } else if (i == 3) {
    if (!strcmp(buf, "S"))
      strcpy(get, "睡眠中");
    else if (!strcmp(buf, "R"))
      strcpy(get, "运行中");
    else if (!strcmp(buf, "T"))
      strcpy(get, "已停止");
    else if (!strcmp(buf, "D"))
      strcpy(get, "不可中断");
    else if (!strcmp(buf, "Z"))
      strcpy(get, "死锁中");
  } else
    strcpy(get, buf);
}


x86 assembly (clang, -O0):
<read_info>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1186 <read_info+0x66>
mov    -0x8(%rbp),%rax
mov    -0x1c(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x1c(%rbp)
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x20,%eax
jne    1181 <read_info+0x61>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1148 <read_info+0x28>
jmp    118b <read_info+0x6b>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x20,%eax
je     11ca <read_info+0xaa>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,1),%cl
mov    -0x20(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x20(%rbp)
cltq
mov    %cl,-0x40(%rbp,%rax,1)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    118b <read_info+0x6b>
movslq -0x20(%rbp),%rax
movb   $0x0,-0x40(%rbp,%rax,1)
mov    $0x2,%eax
cmp    -0xc(%rbp),%eax
jne    1241 <read_info+0x121>
movl   $0x0,-0x48(%rbp)
movl   $0x1,-0x44(%rbp)
movslq -0x44(%rbp),%rax
movsbl -0x40(%rbp,%rax,1),%ecx
mov    $0x29,%eax
cmp    %ecx,%eax
je     1230 <read_info+0x110>
movslq -0x44(%rbp),%rax
mov    -0x40(%rbp,%rax,1),%dl
mov    -0x18(%rbp),%rax
mov    -0x48(%rbp),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    %esi,-0x48(%rbp)
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    11ef <read_info+0xcf>
mov    -0x18(%rbp),%rax
movslq -0x48(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
jmp    1357 <read_info+0x237>
cmpl   $0x3,-0xc(%rbp)
jne    1345 <read_info+0x225>
lea    -0x40(%rbp),%rdi
lea    0xdaa(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    1279 <read_info+0x159>
mov    -0x18(%rbp),%rdi
lea    0xd93(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1340 <read_info+0x220>
lea    -0x40(%rbp),%rdi
lea    0xd88(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    12a7 <read_info+0x187>
mov    -0x18(%rbp),%rdi
lea    0xd71(%rip),%rsi
call   1030 <strcpy@plt>
jmp    133b <read_info+0x21b>
lea    -0x40(%rbp),%rdi
lea    0xd66(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    12d5 <read_info+0x1b5>
mov    -0x18(%rbp),%rdi
lea    0xd4f(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1336 <read_info+0x216>
lea    -0x40(%rbp),%rdi
lea    0xd44(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    1303 <read_info+0x1e3>
mov    -0x18(%rbp),%rdi
lea    0xd2d(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1331 <read_info+0x211>
lea    -0x40(%rbp),%rdi
lea    0xd25(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    132c <read_info+0x20c>
mov    -0x18(%rbp),%rdi
lea    0xd0e(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1331 <read_info+0x211>
jmp    1336 <read_info+0x216>
jmp    133b <read_info+0x21b>
jmp    1340 <read_info+0x220>
jmp    1352 <read_info+0x232>
mov    -0x18(%rbp),%rdi
lea    -0x40(%rbp),%rsi
call   1030 <strcpy@plt>
jmp    1357 <read_info+0x237>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_info>:
sub    $0x18,%rsp
xor    %r9d,%r9d
cmp    $0x2,%esi
jl     1148 <read_info+0x38>
lea    -0x1(%rsi),%r8d
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
cmpb   $0x20,(%rdi,%rcx,1)
lea    0x1(%rcx),%rcx
sete   %al
add    %eax,%r9d
cmp    %r8d,%r9d
jl     1130 <read_info+0x20>
mov    %ecx,%r9d
mov    (%rdi,%r9,1),%cl
cmp    $0x20,%cl
jne    1155 <read_info+0x45>
xor    %eax,%eax
jmp    1172 <read_info+0x62>
lea    (%r9,%rdi,1),%rax
add    $0x1,%rax
xor    %edi,%edi
nop
mov    %cl,(%rsp,%rdi,1)
movzbl (%rax,%rdi,1),%ecx
add    $0x1,%rdi
cmp    $0x20,%cl
jne    1160 <read_info+0x50>
mov    %edi,%eax
movb   $0x0,(%rsp,%rax,1)
cmp    $0x3,%esi
je     118c <read_info+0x7c>
cmp    $0x2,%esi
jne    11b4 <read_info+0xa4>
mov    0x1(%rsp),%al
cmp    $0x29,%al
jne    11c4 <read_info+0xb4>
xor    %eax,%eax
jmp    11e2 <read_info+0xd2>
mov    (%rsp),%eax
add    $0xffffffbc,%eax
cmp    $0x16,%ax
ja     11bf <read_info+0xaf>
movzwl %ax,%eax
lea    0xe5e(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xec8(%rip),%rsi
jmp    120d <read_info+0xfd>
mov    %rsp,%rsi
mov    %rdx,%rdi
call   1030 <strcpy@plt>
add    $0x18,%rsp
ret
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
mov    %al,(%rdx,%rcx,1)
movzbl 0x2(%rsp,%rcx,1),%eax
add    $0x1,%rcx
cmp    $0x29,%al
jne    11d0 <read_info+0xc0>
mov    %ecx,%eax
movb   $0x0,(%rdx,%rax,1)
add    $0x18,%rsp
ret
lea    0xe74(%rip),%rsi
jmp    120d <read_info+0xfd>
lea    0xe61(%rip),%rsi
jmp    120d <read_info+0xfd>
lea    0xe6c(%rip),%rsi
jmp    120d <read_info+0xfd>
lea    0xe7a(%rip),%rsi
mov    %rdx,%rdi
add    $0x18,%rsp
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"S\00"
@.str.1 = [10 x i8] c"\E7\9D\A1\E7\9C\A0\E4\B8\AD\00"
@.str.2 = [2 x i8] c"R\00"
@.str.3 = [10 x i8] c"\E8\BF\90\E8\A1\8C\E4\B8\AD\00"
@.str.4 = [2 x i8] c"T\00"
@.str.5 = [10 x i8] c"\E5\B7\B2\E5\81\9C\E6\AD\A2\00"
@.str.6 = [2 x i8] c"D\00"
@.str.7 = [13 x i8] c"\E4\B8\8D\E5\8F\AF\E4\B8\AD\E6\96\AD\00"
@.str.8 = [2 x i8] c"Z\00"
@.str.9 = [10 x i8] c"\E6\AD\BB\E9\94\81\E4\B8\AD\00"
define void @read_info(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca [20 x i8]
%11 = alloca i32
%12 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
store i32 0, i32* %7
store i32 0, i32* %8
store i32 0, i32* %9
br label %13
13: ; preds = %30, %3
%14 = load i32, i32* %9
%15 = load i32, i32* %5
%16 = sub nsw i32 %15, 1
%17 = icmp slt i32 %14, %16
br i1 %17, label %18, label %31
18: ; preds = %13
%19 = load i8*, i8** %4
%20 = load i32, i32* %7
%21 = add nsw i32 %20, 1
store i32 %21, i32* %7
%22 = sext i32 %20 to i64
%23 = getelementptr inbounds i8, i8* %19, i64 %22
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = icmp eq i32 %25, 32
br i1 %26, label %27, label %30
27: ; preds = %18
%28 = load i32, i32* %9
%29 = add nsw i32 %28, 1
store i32 %29, i32* %9
br label %30
30: ; preds = %27, %18
br label %13
31: ; preds = %13
br label %32
32: ; preds = %40, %31
%33 = load i8*, i8** %4
%34 = load i32, i32* %7
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds i8, i8* %33, i64 %35
%37 = load i8, i8* %36
%38 = sext i8 %37 to i32
%39 = icmp ne i32 %38, 32
br i1 %39, label %40, label %52
40: ; preds = %32
%41 = load i8*, i8** %4
%42 = load i32, i32* %7
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds i8, i8* %41, i64 %43
%45 = load i8, i8* %44
%46 = load i32, i32* %8
%47 = add nsw i32 %46, 1
store i32 %47, i32* %8
%48 = sext i32 %46 to i64
%49 = getelementptr inbounds [20 x i8], [20 x i8]* %10, i64 0, i64 %48
store i8 %45, i8* %49
%50 = load i32, i32* %7
%51 = add nsw i32 %50, 1
store i32 %51, i32* %7
br label %32
52: ; preds = %32
%53 = load i32, i32* %8
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds [20 x i8], [20 x i8]* %10, i64 0, i64 %54
store i8 0, i8* %55
%56 = load i32, i32* %5
%57 = icmp eq i32 2, %56
br i1 %57, label %58, label %84
58: ; preds = %52
store i32 0, i32* %12
store i32 1, i32* %11
br label %59
59: ; preds = %76, %58
%60 = load i32, i32* %11
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds [20 x i8], [20 x i8]* %10, i64 0, i64 %61
%63 = load i8, i8* %62
%64 = sext i8 %63 to i32
%65 = icmp ne i32 41, %64
br i1 %65, label %66, label %79
66: ; preds = %59
%67 = load i32, i32* %11
%68 = sext i32 %67 to i64
%69 = getelementptr inbounds [20 x i8], [20 x i8]* %10, i64 0, i64 %68
%70 = load i8, i8* %69
%71 = load i8*, i8** %6
%72 = load i32, i32* %12
%73 = add nsw i32 %72, 1
store i32 %73, i32* %12
%74 = sext i32 %72 to i64
%75 = getelementptr inbounds i8, i8* %71, i64 %74
store i8 %70, i8* %75
br label %76
76: ; preds = %66
%77 = load i32, i32* %11
%78 = add nsw i32 %77, 1
store i32 %78, i32* %11
br label %59
79: ; preds = %59
%80 = load i8*, i8** %6
%81 = load i32, i32* %12
%82 = sext i32 %81 to i64
%83 = getelementptr inbounds i8, i8* %80, i64 %82
store i8 0, i8* %83
br label %132
84: ; preds = %52
%85 = load i32, i32* %5
%86 = icmp eq i32 %85, 3
br i1 %86, label %87, label %127
87: ; preds = %84
%88 = getelementptr inbounds [20 x i8], [20 x i8]* %10, i64 0, i64 0
%89 = call i32 @strcmp(i8* %88, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%90 = icmp ne i32 %89, 0
br i1 %90, label %94, label %91
91: ; preds = %87
%92 = load i8*, i8** %6
%93 = call i32 @strcpy(i8* %92, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
br label %126
94: ; preds = %87
%95 = getelementptr inbounds [20 x i8], [20 x i8]* %10, i64 0, i64 0
%96 = call i32 @strcmp(i8* %95, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%97 = icmp ne i32 %96, 0
br i1 %97, label %101, label %98
98: ; preds = %94
%99 = load i8*, i8** %6
%100 = call i32 @strcpy(i8* %99, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
br label %125
101: ; preds = %94
%102 = getelementptr inbounds [20 x i8], [20 x i8]* %10, i64 0, i64 0
%103 = call i32 @strcmp(i8* %102, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%104 = icmp ne i32 %103, 0
br i1 %104, label %108, label %105
105: ; preds = %101
%106 = load i8*, i8** %6
%107 = call i32 @strcpy(i8* %106, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
br label %124
108: ; preds = %101
%109 = getelementptr inbounds [20 x i8], [20 x i8]* %10, i64 0, i64 0
%110 = call i32 @strcmp(i8* %109, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%111 = icmp ne i32 %110, 0
br i1 %111, label %115, label %112
112: ; preds = %108
%113 = load i8*, i8** %6
%114 = call i32 @strcpy(i8* %113, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0))
br label %123
115: ; preds = %108
%116 = getelementptr inbounds [20 x i8], [20 x i8]* %10, i64 0, i64 0
%117 = call i32 @strcmp(i8* %116, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
%118 = icmp ne i32 %117, 0
br i1 %118, label %122, label %119
119: ; preds = %115
%120 = load i8*, i8** %6
%121 = call i32 @strcpy(i8* %120, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0))
br label %122
122: ; preds = %119, %115
br label %123
123: ; preds = %122, %112
br label %124
124: ; preds = %123, %105
br label %125
125: ; preds = %124, %98
br label %126
126: ; preds = %125, %91
br label %131
127: ; preds = %84
%128 = load i8*, i8** %6
%129 = getelementptr inbounds [20 x i8], [20 x i8]* %10, i64 0, i64 0
%130 = call i32 @strcpy(i8* %128, i8* %129)
br label %131
131: ; preds = %127, %126
br label %132
132: ; preds = %131, %79
ret void
}

LLVM IR (-O2):
@.str.1 = [10 x i8] c"\E7\9D\A1\E7\9C\A0\E4\B8\AD\00"
@.str.3 = [10 x i8] c"\E8\BF\90\E8\A1\8C\E4\B8\AD\00"
@.str.5 = [10 x i8] c"\E5\B7\B2\E5\81\9C\E6\AD\A2\00"
@.str.7 = [13 x i8] c"\E4\B8\8D\E5\8F\AF\E4\B8\AD\E6\96\AD\00"
@.str.9 = [10 x i8] c"\E6\AD\BB\E9\94\81\E4\B8\AD\00"
define void @read_info(i8* nocapture %0, i32 %1, i8* %2) {
%4 = alloca [20 x i8]
%5 = getelementptr inbounds [20 x i8], [20 x i8]* %4, i64 0, i64 0
%6 = add nsw i32 %1, -1
%7 = icmp sgt i32 %1, 1
br i1 %7, label %15, label %10
8: ; preds = %15
%9 = and i64 %18, 4294967295
br label %10
10: ; preds = %8, %3
%11 = phi i64 [ 0, %3 ], [ %9, %8 ]
%12 = getelementptr inbounds i8, i8* %0, i64 %11
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 32
br i1 %14, label %37, label %25
15: ; preds = %3, %15
%16 = phi i64 [ %18, %15 ], [ 0, %3 ]
%17 = phi i32 [ %23, %15 ], [ 0, %3 ]
%18 = add nuw i64 %16, 1
%19 = getelementptr inbounds i8, i8* %0, i64 %16
%20 = load i8, i8* %19
%21 = icmp eq i8 %20, 32
%22 = zext i1 %21 to i32
%23 = add nuw nsw i32 %17, %22
%24 = icmp slt i32 %23, %6
br i1 %24, label %15, label %8
25: ; preds = %10, %25
%26 = phi i64 [ %31, %25 ], [ %11, %10 ]
%27 = phi i64 [ %29, %25 ], [ 0, %10 ]
%28 = phi i8 [ %33, %25 ], [ %13, %10 ]
%29 = add nuw i64 %27, 1
%30 = getelementptr inbounds [20 x i8], [20 x i8]* %4, i64 0, i64 %27
store i8 %28, i8* %30
%31 = add nuw i64 %26, 1
%32 = getelementptr inbounds i8, i8* %0, i64 %31
%33 = load i8, i8* %32
%34 = icmp eq i8 %33, 32
br i1 %34, label %35, label %25
35: ; preds = %25
%36 = and i64 %29, 4294967295
br label %37
37: ; preds = %35, %10
%38 = phi i64 [ 0, %10 ], [ %36, %35 ]
%39 = getelementptr inbounds [20 x i8], [20 x i8]* %4, i64 0, i64 %38
store i8 0, i8* %39
switch i32 %1, label %72 [
i32 2, label %40
i32 3, label %59
]
40: ; preds = %37
%41 = getelementptr inbounds [20 x i8], [20 x i8]* %4, i64 0, i64 1
%42 = load i8, i8* %41
%43 = icmp eq i8 %42, 41
br i1 %43, label %56, label %44
44: ; preds = %40, %44
%45 = phi i64 [ %50, %44 ], [ 1, %40 ]
%46 = phi i64 [ %48, %44 ], [ 0, %40 ]
%47 = phi i8 [ %52, %44 ], [ %42, %40 ]
%48 = add nuw i64 %46, 1
%49 = getelementptr inbounds i8, i8* %2, i64 %46
store i8 %47, i8* %49
%50 = add nuw i64 %45, 1
%51 = getelementptr inbounds [20 x i8], [20 x i8]* %4, i64 0, i64 %50
%52 = load i8, i8* %51
%53 = icmp eq i8 %52, 41
br i1 %53, label %54, label %44
54: ; preds = %44
%55 = and i64 %48, 4294967295
br label %56
56: ; preds = %54, %40
%57 = phi i64 [ 0, %40 ], [ %55, %54 ]
%58 = getelementptr inbounds i8, i8* %2, i64 %57
store i8 0, i8* %58
br label %74
59: ; preds = %37
%60 = bitcast [20 x i8]* %4 to i16*
%61 = load i16, i16* %60
switch i16 %61, label %74 [
i16 83, label %62
i16 82, label %64
i16 84, label %66
i16 68, label %68
i16 90, label %70
]
62: ; preds = %59
%63 = tail call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
br label %74
64: ; preds = %59
%65 = tail call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
br label %74
66: ; preds = %59
%67 = tail call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
br label %74
68: ; preds = %59
%69 = tail call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0))
br label %74
70: ; preds = %59
%71 = tail call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0))
br label %74
72: ; preds = %37
%73 = call i32 @strcpy(i8* %2, i8* %5)
br label %74
74: ; preds = %59, %72, %64, %68, %70, %66, %62, %56
ret void
}