#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 atoi(char *const);
int /*<<< orphan*/ commit_kit(char *);
int /*<<< orphan*/ escape_dq(char *);
int /*<<< orphan*/ exit(int);
int getopt(int, char *const *, char *);
scalar_t__ is_num(char *const);
int optind;
int /*<<< orphan*/ printf(char *, int);
int read_kit_file(int, char **);
int /*<<< orphan*/ save_kit_file(int, char **);
int /*<<< orphan*/ strcat(char *, char *);
scalar_t__ strcmp(char *const, char const *);
int /*<<< orphan*/ strcpy(char *, char const *);
void cmd_remove(int argc, char *const argv[]) {
  const char BaseMes[] = "[kit]remove plan ";
  const char BaseMesMany[] = "[kit]remove plans";
  const char BaseMesAll[] = "[kit]remove plans all";
  const char AllCmd[] = "all";
  char buffer[128][128] = {{0}};
  char mes[128];
  int i, num, targets[64], targ_len = 0, n_opt = 0, all_flg = 0;
  if (getopt(argc, argv, "n") != -1) {
    n_opt = 1;
  }
  if (optind < argc) {
    if (strcmp(argv[optind], AllCmd) == 0) {
      all_flg = 1;
    } else {
      while (optind < argc) {
        if (is_num(argv[optind]) == 0) {
          targets[targ_len] = atoi(argv[optind]);
          targ_len++;
        }
        optind++;
      }
    }
  }
  if (targ_len == 0) {
    targets[0] = 0;
    targ_len = 1;
  }
  num = read_kit_file(128, buffer);
  if (n_opt == 0) {
    if (all_flg) {
      strcpy(mes, BaseMesAll);
    } else if (targ_len > 1) {
      strcpy(mes, BaseMesMany);
    } else {
      strcpy(mes, BaseMes);
      escape_dq(buffer[targets[0]]);
      strcat(mes, buffer[targets[0]]);
    }
  }
  if (all_flg) {
    save_kit_file(0, buffer);
  } else {
    for (i = 0; i < targ_len; i++) {
      if (targets[i] >= num) {
        printf("Not exist plan %d\n", targets[i]);
        exit(1);
      }
      buffer[targets[i]][0] = '\0';
    }
    save_kit_file(num, buffer);
  }
  if (n_opt == 0) {
    commit_kit(mes);
  }
}


x86 assembly (clang, -O0):
<cmd_remove>:
push   %rbp
mov    %rsp,%rbp
sub    $0x4220,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xe17(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xe14(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xe11(%rip),%ax
mov    %ax,-0x20(%rbp)
mov    0xe16(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    0xe13(%rip),%rax
mov    %rax,-0x48(%rbp)
mov    0xe10(%rip),%ax
mov    %ax,-0x40(%rbp)
mov    0xe15(%rip),%rax
mov    %rax,-0x70(%rbp)
mov    0xe12(%rip),%rax
mov    %rax,-0x68(%rbp)
mov    0xe10(%rip),%eax
mov    %eax,-0x60(%rbp)
mov    0xe0a(%rip),%ax
mov    %ax,-0x5c(%rbp)
mov    0xe02(%rip),%eax
mov    %eax,-0x74(%rbp)
lea    -0x4080(%rbp),%rdi
xor    %esi,%esi
mov    $0x4000,%edx
call   1060 <memset@plt>
movl   $0x0,-0x4214(%rbp)
movl   $0x0,-0x4218(%rbp)
movl   $0x0,-0x421c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xdc4(%rip),%rdx
call   10c0 <getopt@plt>
cmp    $0xffffffff,%eax
je     12ae <cmd_remove+0xde>
movl   $0x1,-0x4218(%rbp)
mov    0x2d33(%rip),%rax
mov    (%rax),%eax
cmp    -0x4(%rbp),%eax
jge    1386 <cmd_remove+0x1b6>
mov    -0x10(%rbp),%rax
mov    0x2d1d(%rip),%rcx
movslq (%rcx),%rcx
mov    (%rax,%rcx,8),%rdi
lea    -0x74(%rbp),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
jne    12f4 <cmd_remove+0x124>
movl   $0x1,-0x421c(%rbp)
jmp    1381 <cmd_remove+0x1b1>
jmp    12f9 <cmd_remove+0x129>
mov    0x2ce8(%rip),%rax
mov    (%rax),%eax
cmp    -0x4(%rbp),%eax
jge    137c <cmd_remove+0x1ac>
mov    -0x10(%rbp),%rax
mov    0x2cd2(%rip),%rcx
movslq (%rcx),%rcx
mov    (%rax,%rcx,8),%rdi
call   10a0 <is_num@plt>
cmp    $0x0,%rax
jne    1362 <cmd_remove+0x192>
mov    -0x10(%rbp),%rax
mov    0x2cb1(%rip),%rcx
movslq (%rcx),%rcx
mov    (%rax,%rcx,8),%rdi
call   10d0 <atoi@plt>
mov    %eax,%ecx
movslq -0x4214(%rbp),%rax
mov    %ecx,-0x4210(%rbp,%rax,4)
mov    -0x4214(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4214(%rbp)
mov    0x2c7f(%rip),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    0x2c73(%rip),%rax
mov    %ecx,(%rax)
jmp    12f9 <cmd_remove+0x129>
jmp    1381 <cmd_remove+0x1b1>
jmp    1386 <cmd_remove+0x1b6>
cmpl   $0x0,-0x4214(%rbp)
jne    13a7 <cmd_remove+0x1d7>
movl   $0x0,-0x4210(%rbp)
movl   $0x1,-0x4214(%rbp)
lea    -0x4080(%rbp),%rsi
mov    $0x80,%edi
call   1070 <read_kit_file@plt>
mov    %eax,-0x4108(%rbp)
cmpl   $0x0,-0x4218(%rbp)
jne    1464 <cmd_remove+0x294>
cmpl   $0x0,-0x421c(%rbp)
je     13ed <cmd_remove+0x21d>
lea    -0x4100(%rbp),%rdi
lea    -0x70(%rbp),%rsi
call   1030 <strcpy@plt>
jmp    145f <cmd_remove+0x28f>
cmpl   $0x1,-0x4214(%rbp)
jle    140f <cmd_remove+0x23f>
lea    -0x4100(%rbp),%rdi
lea    -0x50(%rbp),%rsi
call   1030 <strcpy@plt>
jmp    145a <cmd_remove+0x28a>
lea    -0x4100(%rbp),%rdi
lea    -0x30(%rbp),%rsi
call   1030 <strcpy@plt>
movslq -0x4210(%rbp),%rax
lea    -0x4080(%rbp),%rdi
shl    $0x7,%rax
add    %rax,%rdi
call   1040 <escape_dq@plt>
lea    -0x4100(%rbp),%rdi
movslq -0x4210(%rbp),%rax
lea    -0x4080(%rbp),%rsi
shl    $0x7,%rax
add    %rax,%rsi
call   10e0 <strcat@plt>
jmp    145f <cmd_remove+0x28f>
jmp    1464 <cmd_remove+0x294>
cmpl   $0x0,-0x421c(%rbp)
je     1484 <cmd_remove+0x2b4>
lea    -0x4080(%rbp),%rsi
xor    %edi,%edi
call   10b0 <save_kit_file@plt>
jmp    1524 <cmd_remove+0x354>
movl   $0x0,-0x4104(%rbp)
mov    -0x4104(%rbp),%eax
cmp    -0x4214(%rbp),%eax
jge    1512 <cmd_remove+0x342>
movslq -0x4104(%rbp),%rax
mov    -0x4210(%rbp,%rax,4),%eax
cmp    -0x4108(%rbp),%eax
jl     14de <cmd_remove+0x30e>
movslq -0x4104(%rbp),%rax
mov    -0x4210(%rbp,%rax,4),%esi
lea    0xb8d(%rip),%rdi
call   1050 <printf@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>
movslq -0x4104(%rbp),%rax
movslq -0x4210(%rbp,%rax,4),%rcx
ff
lea    -0x4080(%rbp),%rax
shl    $0x7,%rcx
add    %rcx,%rax
movb   $0x0,(%rax)
mov    -0x4104(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4104(%rbp)
jmp    148e <cmd_remove+0x2be>
mov    -0x4108(%rbp),%edi
lea    -0x4080(%rbp),%rsi
call   10b0 <save_kit_file@plt>
cmpl   $0x0,-0x4218(%rbp)
jne    153d <cmd_remove+0x36d>
lea    -0x4100(%rbp),%rdi
call   1090 <commit_kit@plt>
add    $0x4220,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_remove>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x41f8,%rsp
mov    %rsi,%rbp
mov    %edi,%r15d
movaps 0xe12(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movw   $0x20,0x40(%rsp)
movaps 0xe1f(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movw   $0x73,0x20(%rsp)
movaps 0xe2c(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movabs $0x6c6c6120736e61,%rax
mov    %rax,0x5e(%rsp)
movl   $0x6c6c61,0xc(%rsp)
lea    0x1f0(%rsp),%rdi
mov    $0x4000,%edx
xor    %esi,%esi
call   1060 <memset@plt>
lea    0xe0b(%rip),%rdx
mov    %r15d,%edi
mov    %rbp,%rsi
call   10c0 <getopt@plt>
mov    %eax,%r14d
mov    0x2d88(%rip),%r13
movslq 0x0(%r13),%rax
mov    $0x1,%r12b
cmp    %r15d,%eax
jge    1325 <cmd_remove+0x155>
mov    0x0(%rbp,%rax,8),%rdi
lea    0xc(%rsp),%rsi
call   1080 <strcmp@plt>
test   %rax,%rax
je     12dc <cmd_remove+0x10c>
mov    %r14d,0x8(%rsp)
mov    0x0(%r13),%r14d
cmp    %r15d,%r14d
jge    12e1 <cmd_remove+0x111>
xor    %ebx,%ebx
jmp    12ad <cmd_remove+0xdd>
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%r14d
mov    %r14d,0x0(%r13)
cmp    %r15d,%r14d
jge    12e8 <cmd_remove+0x118>
movslq %r14d,%rax
mov    0x0(%rbp,%rax,8),%rdi
call   10a0 <is_num@plt>
movslq 0x0(%r13),%r14
test   %rax,%rax
jne    12a0 <cmd_remove+0xd0>
mov    0x0(%rbp,%r14,8),%rdi
call   10d0 <atoi@plt>
movslq %ebx,%rbx
mov    %eax,0xf0(%rsp,%rbx,4)
add    $0x1,%ebx
jmp    12a0 <cmd_remove+0xd0>
xor    %r12d,%r12d
jmp    1325 <cmd_remove+0x155>
mov    0x8(%rsp),%r14d
jmp    1325 <cmd_remove+0x155>
test   %ebx,%ebx
mov    0x8(%rsp),%r14d
je     1325 <cmd_remove+0x155>
lea    0x1f0(%rsp),%rsi
mov    $0x80,%edi
call   1070 <read_kit_file@plt>
mov    %eax,%ebp
cmp    $0xffffffff,%r14d
jne    139a <cmd_remove+0x1ca>
cmp    $0x2,%ebx
jl     135e <cmd_remove+0x18e>
lea    0x70(%rsp),%rdi
lea    0x10(%rsp),%rsi
call   1030 <strcpy@plt>
jmp    139e <cmd_remove+0x1ce>
movl   $0x0,0xf0(%rsp)
lea    0x1f0(%rsp),%rsi
mov    $0x80,%edi
call   1070 <read_kit_file@plt>
mov    %eax,%ebp
mov    $0x1,%ebx
cmp    $0xffffffff,%r14d
je     1359 <cmd_remove+0x189>
test   %r12b,%r12b
jne    139e <cmd_remove+0x1ce>
jmp    13ec <cmd_remove+0x21c>
test   %r12b,%r12b
je     13dd <cmd_remove+0x20d>
lea    0x70(%rsp),%r15
lea    0x30(%rsp),%rsi
mov    %r15,%rdi
call   1030 <strcpy@plt>
movslq 0xf0(%rsp),%rax
shl    $0x7,%rax
lea    (%rsp,%rax,1),%r12
add    $0x1f0,%r12
mov    %r12,%rdi
call   1040 <escape_dq@plt>
mov    %r15,%rdi
mov    %r12,%rsi
call   10e0 <strcat@plt>
test   %ebx,%ebx
jle    13d1 <cmd_remove+0x201>
mov    %ebx,%eax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movslq 0xf0(%rsp,%rcx,4),%rsi
cmp    %ebp,%esi
jge    141d <cmd_remove+0x24d>
shl    $0x7,%rsi
movb   $0x0,0x1f0(%rsp,%rsi,1)
add    $0x1,%rcx
cmp    %rcx,%rax
jne    13b0 <cmd_remove+0x1e0>
lea    0x1f0(%rsp),%rsi
mov    %ebp,%edi
jmp    13f6 <cmd_remove+0x226>
lea    0x70(%rsp),%rdi
lea    0x50(%rsp),%rsi
call   1030 <strcpy@plt>
lea    0x1f0(%rsp),%rsi
xor    %edi,%edi
call   10b0 <save_kit_file@plt>
cmp    $0xffffffff,%r14d
jne    140b <cmd_remove+0x23b>
lea    0x70(%rsp),%rdi
call   1090 <commit_kit@plt>
add    $0x41f8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xc34(%rip),%rdi
call   1050 <printf@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>

LLVM IR (-O0):
@__const.cmd_remove.BaseMes = [18 x i8] c"[kit]remove plan \00"
@__const.cmd_remove.BaseMesMany = [18 x i8] c"[kit]remove plans\00"
@__const.cmd_remove.BaseMesAll = [22 x i8] c"[kit]remove plans all\00"
@__const.cmd_remove.AllCmd = [4 x i8] c"all\00"
@.str = [2 x i8] c"n\00"
@optind = global i32 0
@.str.1 = [19 x i8] c"Not exist plan %d\0A\00"
define void @cmd_remove(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca [18 x i8]
%6 = alloca [18 x i8]
%7 = alloca [22 x i8]
%8 = alloca [4 x i8]
%9 = alloca [128 x [128 x i8]]
%10 = alloca [128 x i8]
%11 = alloca i32
%12 = alloca i32
%13 = alloca [64 x i32]
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
%17 = bitcast [18 x i8]* %5 to i8*
%18 = bitcast [18 x i8]* %6 to i8*
%19 = bitcast [22 x i8]* %7 to i8*
%20 = bitcast [4 x i8]* %8 to i8*
%21 = bitcast [128 x [128 x i8]]* %9 to i8*
store i32 0, i32* %14
store i32 0, i32* %15
store i32 0, i32* %16
%22 = load i32, i32* %3
%23 = load i8**, i8*** %4
%24 = call i32 @getopt(i32 %22, i8** %23, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%25 = icmp ne i32 %24, -1
br i1 %25, label %26, label %27
26: ; preds = %2
store i32 1, i32* %15
br label %27
27: ; preds = %26, %2
%28 = load i32, i32* @optind
%29 = load i32, i32* %3
%30 = icmp slt i32 %28, %29
br i1 %30, label %31, label %71
31: ; preds = %27
%32 = load i8**, i8*** %4
%33 = load i32, i32* @optind
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds i8*, i8** %32, i64 %34
%36 = load i8*, i8** %35
%37 = getelementptr inbounds [4 x i8], [4 x i8]* %8, i64 0, i64 0
%38 = call i64 @strcmp(i8* %36, i8* %37)
%39 = icmp eq i64 %38, 0
br i1 %39, label %40, label %41
40: ; preds = %31
store i32 1, i32* %16
br label %70
41: ; preds = %31
br label %42
42: ; preds = %66, %41
%43 = load i32, i32* @optind
%44 = load i32, i32* %3
%45 = icmp slt i32 %43, %44
br i1 %45, label %46, label %69
46: ; preds = %42
%47 = load i8**, i8*** %4
%48 = load i32, i32* @optind
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds i8*, i8** %47, i64 %49
%51 = load i8*, i8** %50
%52 = call i64 @is_num(i8* %51)
%53 = icmp eq i64 %52, 0
br i1 %53, label %54, label %66
54: ; preds = %46
%55 = load i8**, i8*** %4
%56 = load i32, i32* @optind
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds i8*, i8** %55, i64 %57
%59 = load i8*, i8** %58
%60 = call i32 @atoi(i8* %59)
%61 = load i32, i32* %14
%62 = sext i32 %61 to i64
%63 = getelementptr inbounds [64 x i32], [64 x i32]* %13, i64 0, i64 %62
store i32 %60, i32* %63
%64 = load i32, i32* %14
%65 = add nsw i32 %64, 1
store i32 %65, i32* %14
br label %66
66: ; preds = %54, %46
%67 = load i32, i32* @optind
%68 = add nsw i32 %67, 1
store i32 %68, i32* @optind
br label %42
69: ; preds = %42
br label %70
70: ; preds = %69, %40
br label %71
71: ; preds = %70, %27
%72 = load i32, i32* %14
%73 = icmp eq i32 %72, 0
br i1 %73, label %74, label %76
74: ; preds = %71
%75 = getelementptr inbounds [64 x i32], [64 x i32]* %13, i64 0, i64 0
store i32 0, i32* %75
store i32 1, i32* %14
br label %76
76: ; preds = %74, %71
%77 = getelementptr inbounds [128 x [128 x i8]], [128 x [128 x i8]]* %9, i64 0, i64 0
%78 = bitcast [128 x i8]* %77 to i8**
%79 = call i32 @read_kit_file(i32 128, i8** %78)
store i32 %79, i32* %12
%80 = load i32, i32* %15
%81 = icmp eq i32 %80, 0
br i1 %81, label %82, label %115
82: ; preds = %76
%83 = load i32, i32* %16
%84 = icmp ne i32 %83, 0
br i1 %84, label %85, label %89
85: ; preds = %82
%86 = getelementptr inbounds [128 x i8], [128 x i8]* %10, i64 0, i64 0
%87 = getelementptr inbounds [22 x i8], [22 x i8]* %7, i64 0, i64 0
%88 = call i32 @strcpy(i8* %86, i8* %87)
br label %114
89: ; preds = %82
%90 = load i32, i32* %14
%91 = icmp sgt i32 %90, 1
br i1 %91, label %92, label %96
92: ; preds = %89
%93 = getelementptr inbounds [128 x i8], [128 x i8]* %10, i64 0, i64 0
%94 = getelementptr inbounds [18 x i8], [18 x i8]* %6, i64 0, i64 0
%95 = call i32 @strcpy(i8* %93, i8* %94)
br label %113
96: ; preds = %89
%97 = getelementptr inbounds [128 x i8], [128 x i8]* %10, i64 0, i64 0
%98 = getelementptr inbounds [18 x i8], [18 x i8]* %5, i64 0, i64 0
%99 = call i32 @strcpy(i8* %97, i8* %98)
%100 = getelementptr inbounds [64 x i32], [64 x i32]* %13, i64 0, i64 0
%101 = load i32, i32* %100
%102 = sext i32 %101 to i64
%103 = getelementptr inbounds [128 x [128 x i8]], [128 x [128 x i8]]* %9, i64 0, i64 %102
%104 = getelementptr inbounds [128 x i8], [128 x i8]* %103, i64 0, i64 0
%105 = call i32 @escape_dq(i8* %104)
%106 = getelementptr inbounds [128 x i8], [128 x i8]* %10, i64 0, i64 0
%107 = getelementptr inbounds [64 x i32], [64 x i32]* %13, i64 0, i64 0
%108 = load i32, i32* %107
%109 = sext i32 %108 to i64
%110 = getelementptr inbounds [128 x [128 x i8]], [128 x [128 x i8]]* %9, i64 0, i64 %109
%111 = getelementptr inbounds [128 x i8], [128 x i8]* %110, i64 0, i64 0
%112 = call i32 @strcat(i8* %106, i8* %111)
br label %113
113: ; preds = %96, %92
br label %114
114: ; preds = %113, %85
br label %115
115: ; preds = %114, %76
%116 = load i32, i32* %16
%117 = icmp ne i32 %116, 0
br i1 %117, label %118, label %122
118: ; preds = %115
%119 = getelementptr inbounds [128 x [128 x i8]], [128 x [128 x i8]]* %9, i64 0, i64 0
%120 = bitcast [128 x i8]* %119 to i8**
%121 = call i32 @save_kit_file(i32 0, i8** %120)
br label %157
122: ; preds = %115
store i32 0, i32* %11
br label %123
123: ; preds = %149, %122
%124 = load i32, i32* %11
%125 = load i32, i32* %14
%126 = icmp slt i32 %124, %125
br i1 %126, label %127, label %152
127: ; preds = %123
%128 = load i32, i32* %11
%129 = sext i32 %128 to i64
%130 = getelementptr inbounds [64 x i32], [64 x i32]* %13, i64 0, i64 %129
%131 = load i32, i32* %130
%132 = load i32, i32* %12
%133 = icmp sge i32 %131, %132
br i1 %133, label %134, label %141
134: ; preds = %127
%135 = load i32, i32* %11
%136 = sext i32 %135 to i64
%137 = getelementptr inbounds [64 x i32], [64 x i32]* %13, i64 0, i64 %136
%138 = load i32, i32* %137
%139 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 %138)
%140 = call i32 @exit(i32 1)
unreachable
141: ; preds = %127
%142 = load i32, i32* %11
%143 = sext i32 %142 to i64
%144 = getelementptr inbounds [64 x i32], [64 x i32]* %13, i64 0, i64 %143
%145 = load i32, i32* %144
%146 = sext i32 %145 to i64
%147 = getelementptr inbounds [128 x [128 x i8]], [128 x [128 x i8]]* %9, i64 0, i64 %146
%148 = getelementptr inbounds [128 x i8], [128 x i8]* %147, i64 0, i64 0
store i8 0, i8* %148
br label %149
149: ; preds = %141
%150 = load i32, i32* %11
%151 = add nsw i32 %150, 1
store i32 %151, i32* %11
br label %123
152: ; preds = %123
%153 = load i32, i32* %12
%154 = getelementptr inbounds [128 x [128 x i8]], [128 x [128 x i8]]* %9, i64 0, i64 0
%155 = bitcast [128 x i8]* %154 to i8**
%156 = call i32 @save_kit_file(i32 %153, i8** %155)
br label %157
157: ; preds = %152, %118
%158 = load i32, i32* %15
%159 = icmp eq i32 %158, 0
br i1 %159, label %160, label %163
160: ; preds = %157
%161 = getelementptr inbounds [128 x i8], [128 x i8]* %10, i64 0, i64 0
%162 = call i32 @commit_kit(i8* %161)
br label %163
163: ; preds = %160, %157
ret void
}

LLVM IR (-O2):
@__const.cmd_remove.BaseMes = [18 x i8] c"[kit]remove plan \00"
@__const.cmd_remove.BaseMesMany = [18 x i8] c"[kit]remove plans\00"
@__const.cmd_remove.BaseMesAll = [22 x i8] c"[kit]remove plans all\00"
@.str = [2 x i8] c"n\00"
@optind = global i32 0
@.str.1 = [19 x i8] c"Not exist plan %d\0A\00"
define void @cmd_remove(i32 %0, i8** %1) {
%3 = alloca [18 x i8]
%4 = alloca [18 x i8]
%5 = alloca [22 x i8]
%6 = alloca i32
%7 = alloca [128 x [128 x i8]]
%8 = alloca [128 x i8]
%9 = alloca [64 x i32]
%10 = getelementptr inbounds [18 x i8], [18 x i8]* %3, i64 0, i64 0
%11 = getelementptr inbounds [18 x i8], [18 x i8]* %4, i64 0, i64 0
%12 = getelementptr inbounds [22 x i8], [22 x i8]* %5, i64 0, i64 0
%13 = bitcast i32* %6 to i8*
store i32 7105633, i32* %6
%14 = getelementptr inbounds [128 x [128 x i8]], [128 x [128 x i8]]* %7, i64 0, i64 0, i64 0
%15 = getelementptr inbounds [128 x i8], [128 x i8]* %8, i64 0, i64 0
%16 = bitcast [64 x i32]* %9 to i8*
%17 = tail call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%18 = icmp eq i32 %17, -1
%19 = load i32, i32* @optind
%20 = icmp slt i32 %19, %0
br i1 %20, label %21, label %53
21: ; preds = %2
%22 = sext i32 %19 to i64
%23 = getelementptr inbounds i8*, i8** %1, i64 %22
%24 = load i8*, i8** %23
%25 = call i64 @strcmp(i8* %24, i8* %13)
%26 = icmp eq i64 %25, 0
br i1 %26, label %53, label %27
27: ; preds = %21
%28 = load i32, i32* @optind
%29 = icmp slt i32 %28, %0
br i1 %29, label %30, label %53
30: ; preds = %27, %47
%31 = phi i32 [ %49, %47 ], [ %28, %27 ]
%32 = phi i32 [ %48, %47 ], [ 0, %27 ]
%33 = sext i32 %31 to i64
%34 = getelementptr inbounds i8*, i8** %1, i64 %33
%35 = load i8*, i8** %34
%36 = call i64 @is_num(i8* %35)
%37 = icmp eq i64 %36, 0
%38 = load i32, i32* @optind
br i1 %37, label %39, label %47
39: ; preds = %30
%40 = sext i32 %38 to i64
%41 = getelementptr inbounds i8*, i8** %1, i64 %40
%42 = load i8*, i8** %41
%43 = call i32 @atoi(i8* %42)
%44 = sext i32 %32 to i64
%45 = getelementptr inbounds [64 x i32], [64 x i32]* %9, i64 0, i64 %44
store i32 %43, i32* %45
%46 = add nsw i32 %32, 1
br label %47
47: ; preds = %30, %39
%48 = phi i32 [ %46, %39 ], [ %32, %30 ]
%49 = add nsw i32 %38, 1
store i32 %49, i32* @optind
%50 = icmp slt i32 %49, %0
br i1 %50, label %30, label %51
51: ; preds = %47
%52 = icmp eq i32 %48, 0
br i1 %52, label %53, label %58
53: ; preds = %51, %2, %21, %27
%54 = phi i1 [ true, %51 ], [ false, %21 ], [ true, %2 ], [ true, %27 ]
%55 = getelementptr inbounds [64 x i32], [64 x i32]* %9, i64 0, i64 0
store i32 0, i32* %55
%56 = bitcast [128 x [128 x i8]]* %7 to i8**
%57 = call i32 @read_kit_file(i32 128, i8** %56)
br i1 %18, label %61, label %78
58: ; preds = %51
%59 = bitcast [128 x [128 x i8]]* %7 to i8**
%60 = call i32 @read_kit_file(i32 128, i8** %59)
br i1 %18, label %64, label %79
61: ; preds = %53
br i1 %54, label %68, label %62
62: ; preds = %61
%63 = call i32 @strcpy(i8* %15, i8* %12)
br label %87
64: ; preds = %58
%65 = icmp sgt i32 %48, 1
br i1 %65, label %66, label %68
66: ; preds = %64
%67 = call i32 @strcpy(i8* %15, i8* %11)
br label %83
68: ; preds = %61, %64
%69 = phi i32 [ %60, %64 ], [ %57, %61 ]
%70 = phi i32 [ %48, %64 ], [ 1, %61 ]
%71 = call i32 @strcpy(i8* %15, i8* %10)
%72 = getelementptr inbounds [64 x i32], [64 x i32]* %9, i64 0, i64 0
%73 = load i32, i32* %72
%74 = sext i32 %73 to i64
%75 = getelementptr inbounds [128 x [128 x i8]], [128 x [128 x i8]]* %7, i64 0, i64 %74, i64 0
%76 = call i32 @escape_dq(i8* %75)
%77 = call i32 @strcat(i8* %15, i8* %75)
br label %79
78: ; preds = %53
br i1 %54, label %83, label %87
79: ; preds = %58, %68
%80 = phi i32 [ %69, %68 ], [ %60, %58 ]
%81 = phi i32 [ %70, %68 ], [ %48, %58 ]
%82 = icmp sgt i32 %81, 0
br i1 %82, label %83, label %102
83: ; preds = %78, %66, %79
%84 = phi i32 [ %80, %79 ], [ %60, %66 ], [ %57, %78 ]
%85 = phi i32 [ %81, %79 ], [ %48, %66 ], [ 1, %78 ]
%86 = zext i32 %85 to i64
br label %89
87: ; preds = %62, %78
%88 = call i32 @save_kit_file(i32 0, i8** %56)
br label %106
89: ; preds = %83, %97
%90 = phi i64 [ 0, %83 ], [ %100, %97 ]
%91 = getelementptr inbounds [64 x i32], [64 x i32]* %9, i64 0, i64 %90
%92 = load i32, i32* %91
%93 = icmp slt i32 %92, %84
br i1 %93, label %97, label %94
94: ; preds = %89
%95 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 %92)
%96 = call i32 @exit(i32 1)
unreachable
97: ; preds = %89
%98 = sext i32 %92 to i64
%99 = getelementptr inbounds [128 x [128 x i8]], [128 x [128 x i8]]* %7, i64 0, i64 %98, i64 0
store i8 0, i8* %99
%100 = add nuw nsw i64 %90, 1
%101 = icmp eq i64 %100, %86
br i1 %101, label %102, label %89
102: ; preds = %97, %79
%103 = phi i32 [ %80, %79 ], [ %84, %97 ]
%104 = bitcast [128 x [128 x i8]]* %7 to i8**
%105 = call i32 @save_kit_file(i32 %103, i8** %104)
br label %106
106: ; preds = %102, %87
br i1 %18, label %107, label %109
107: ; preds = %106
%108 = call i32 @commit_kit(i8* %15)
br label %109
109: ; preds = %107, %106
ret void
}