#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 */
struct dirent {
  char *d_name;
};
typedef int ssize_t;
typedef int /*<<< orphan*/ buf;
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ SIGTERM;
int atoi(char *);
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ closedir(int /*<<< orphan*/ *);
int /*<<< orphan*/ kill(int, int /*<<< orphan*/);
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ *opendir(char *);
int read(int, char *, int);
struct dirent *readdir(int /*<<< orphan*/ *);
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ *strstr(char *, char *);
void kill_pppd_by_cmd(int unit) {
  int pid;
  DIR *dir;
  struct dirent *file;
  char *name, pppd_cmd[64], cmdline[64], buf[128];
  if ((dir = opendir("/proc")) == NULL)
    return;
  sprintf(pppd_cmd, "pppoe-session%d", unit + 1);
  for (;;) {
    int fd;
    ssize_t n;
    if ((file = readdir(dir)) == NULL) {
      closedir(dir);
      return;
    }
    name = file->d_name;
    if (!(*name >= '0' && *name <= '9'))
      continue;
    pid = atoi(name);
    sprintf(cmdline, "/proc/%d/cmdline", pid);
    if ((fd = open(cmdline, O_RDONLY)) < 0)
      continue;
    if ((n = read(fd, buf, sizeof(buf) - 1)) < 1) {
      close(fd);
      continue;
    }
    close(fd);
    if (buf[n - 1] == '\n')
      buf[--n] = 0;
    name = buf;
    while (n) {
      if (*name < ' ')
        *name = ' ';
      name++;
      n--;
    }
    *name = 0;
    if (buf[10] != 'p' || buf[11] != 'p' || buf[12] != 'p' || buf[13] != 'd')
      continue;
    if (strstr(&buf[14], pppd_cmd) == NULL)
      continue;
    kill(pid, SIGTERM);
    closedir(dir);
    return;
  }
}


x86 assembly (clang, -O0):
<kill_pppd_by_cmd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x130,%rsp
mov    %edi,-0x4(%rbp)
lea    0xe4b(%rip),%rdi
call   1030 <opendir@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    11cd <kill_pppd_by_cmd+0x2d>
jmp    13d1 <kill_pppd_by_cmd+0x231>
lea    -0x60(%rbp),%rdi
mov    -0x4(%rbp),%edx
add    $0x1,%edx
lea    0xe28(%rip),%rsi
call   10b0 <sprintf@plt>
mov    -0x10(%rbp),%rdi
call   1080 <readdir@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1208 <kill_pppd_by_cmd+0x68>
mov    -0x10(%rbp),%rdi
call   1050 <closedir@plt>
jmp    13d1 <kill_pppd_by_cmd+0x231>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x30,%eax
jl     1233 <kill_pppd_by_cmd+0x93>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x39,%eax
jle    1238 <kill_pppd_by_cmd+0x98>
jmp    11e3 <kill_pppd_by_cmd+0x43>
mov    -0x20(%rbp),%rdi
call   10a0 <atoi@plt>
mov    %eax,-0x8(%rbp)
lea    -0xa0(%rbp),%rdi
mov    -0x8(%rbp),%edx
lea    0xdc1(%rip),%rsi
call   10b0 <sprintf@plt>
lea    -0xa0(%rbp),%rdi
mov    0x2d80(%rip),%rax
mov    (%rax),%esi
call   1090 <open@plt>
mov    %eax,-0x124(%rbp)
cmp    $0x0,%eax
jge    1283 <kill_pppd_by_cmd+0xe3>
jmp    11e3 <kill_pppd_by_cmd+0x43>
mov    -0x124(%rbp),%edi
lea    -0x120(%rbp),%rsi
mov    $0x7f,%edx
call   1060 <read@plt>
mov    %eax,-0x128(%rbp)
cmp    $0x1,%eax
jge    12b9 <kill_pppd_by_cmd+0x119>
mov    -0x124(%rbp),%edi
call   1040 <close@plt>
jmp    11e3 <kill_pppd_by_cmd+0x43>
mov    -0x124(%rbp),%edi
call   1040 <close@plt>
mov    -0x128(%rbp),%eax
sub    $0x1,%eax
cltq
movsbl -0x120(%rbp,%rax,1),%eax
ff
cmp    $0xa,%eax
jne    12f9 <kill_pppd_by_cmd+0x159>
mov    -0x128(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x128(%rbp)
cltq
movb   $0x0,-0x120(%rbp,%rax,1)
lea    -0x120(%rbp),%rax
mov    %rax,-0x20(%rbp)
cmpl   $0x0,-0x128(%rbp)
je     1348 <kill_pppd_by_cmd+0x1a8>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
jge    1328 <kill_pppd_by_cmd+0x188>
mov    -0x20(%rbp),%rax
movb   $0x20,(%rax)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
mov    -0x128(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x128(%rbp)
jmp    1304 <kill_pppd_by_cmd+0x164>
mov    -0x20(%rbp),%rax
movb   $0x0,(%rax)
movsbl -0x116(%rbp),%eax
cmp    $0x70,%eax
jne    138f <kill_pppd_by_cmd+0x1ef>
movsbl -0x115(%rbp),%eax
cmp    $0x70,%eax
jne    138f <kill_pppd_by_cmd+0x1ef>
movsbl -0x114(%rbp),%eax
cmp    $0x70,%eax
jne    138f <kill_pppd_by_cmd+0x1ef>
movsbl -0x113(%rbp),%eax
cmp    $0x64,%eax
je     1394 <kill_pppd_by_cmd+0x1f4>
jmp    11e3 <kill_pppd_by_cmd+0x43>
lea    -0x120(%rbp),%rdi
add    $0xe,%rdi
lea    -0x60(%rbp),%rsi
call   10c0 <strstr@plt>
cmp    $0x0,%rax
jne    13b7 <kill_pppd_by_cmd+0x217>
jmp    11e3 <kill_pppd_by_cmd+0x43>
mov    -0x8(%rbp),%edi
mov    0x2c1f(%rip),%rax
mov    (%rax),%esi
call   1070 <kill@plt>
mov    -0x10(%rbp),%rdi
call   1050 <closedir@plt>
add    $0x130,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kill_pppd_by_cmd>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x108,%rsp
mov    %edi,%ebp
lea    0xe66(%rip),%rdi
call   1030 <opendir@plt>
test   %rax,%rax
je     14dc <kill_pppd_by_cmd+0x33c>
mov    %rax,%rbx
add    $0x1,%ebp
lea    0xe51(%rip),%rsi
lea    0x80(%rsp),%rdi
mov    %ebp,%edx
call   10b0 <sprintf@plt>
mov    %rbx,%rdi
call   1080 <readdir@plt>
test   %rax,%rax
je     14d4 <kill_pppd_by_cmd+0x334>
lea    0xe3a(%rip),%r15
lea    0xc0(%rsp),%r12
jmp    1221 <kill_pppd_by_cmd+0x81>
cs nopw 0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1080 <readdir@plt>
test   %rax,%rax
je     14d4 <kill_pppd_by_cmd+0x334>
mov    (%rax),%rdi
mov    (%rdi),%al
add    $0xd0,%al
cmp    $0x9,%al
ja     1210 <kill_pppd_by_cmd+0x70>
call   10a0 <atoi@plt>
mov    %eax,%r14d
mov    %r12,%rdi
mov    %r15,%rsi
mov    %eax,%edx
call   10b0 <sprintf@plt>
mov    0x2da0(%rip),%rax
mov    (%rax),%esi
mov    %r12,%rdi
call   1090 <open@plt>
test   %eax,%eax
js     1210 <kill_pppd_by_cmd+0x70>
mov    %eax,%r13d
mov    %eax,%edi
mov    %rsp,%rsi
mov    $0x7f,%edx
call   1060 <read@plt>
mov    %eax,%ebp
mov    %r13d,%edi
call   1040 <close@plt>
test   %ebp,%ebp
jle    1210 <kill_pppd_by_cmd+0x70>
mov    %ebp,%eax
add    $0xffffffff,%ebp
cmpb   $0xa,(%rsp,%rbp,1)
movdqa 0xd79(%rip),%xmm4
jne    129a <kill_pppd_by_cmd+0xfa>
movb   $0x0,(%rsp,%rbp,1)
mov    %ebp,%eax
mov    %rsp,%rcx
test   %ebp,%ebp
je     147b <kill_pppd_by_cmd+0x2db>
lea    -0x1(%rax),%edx
cmp    $0xf,%edx
jae    12aa <kill_pppd_by_cmd+0x10a>
mov    %rsp,%rcx
jmp    14b9 <kill_pppd_by_cmd+0x319>
add    $0x1,%rdx
mov    %rdx,%rsi
and    $0xfffffffffffffff0,%rsi
sub    %esi,%eax
lea    (%rsp,%rsi,1),%rcx
xor    %edi,%edi
movdqa 0xd4b(%rip),%xmm5
jmp    12dd <kill_pppd_by_cmd+0x13d>
nopw   0x0(%rax,%rax,1)
add    $0x10,%rdi
cmp    %rdi,%rsi
je     1476 <kill_pppd_by_cmd+0x2d6>
movq   (%rsp,%rdi,1),%xmm1
movdqa %xmm4,%xmm0
pcmpgtb %xmm1,%xmm0
movd   %xmm0,%ebp
test   $0x1,%bpl
je     12f8 <kill_pppd_by_cmd+0x158>
movb   $0x20,(%rsp,%rdi,1)
movdqa %xmm0,%xmm2
pslld  $0x8,%xmm2
movd   %xmm2,%ebp
shr    $0x10,%ebp
test   $0x1,%bpl
je     1313 <kill_pppd_by_cmd+0x173>
movb   $0x20,0x1(%rsp,%rdi,1)
pshuflw $0x55,%xmm1,%xmm2
movdqa %xmm4,%xmm3
pcmpgtb %xmm2,%xmm3
pextrw $0x2,%xmm3,%ebp
test   $0x1,%bpl
je     1330 <kill_pppd_by_cmd+0x190>
movb   $0x20,0x2(%rsp,%rdi,1)
movdqa %xmm0,%xmm2
psllq  $0x18,%xmm2
pextrw $0x3,%xmm2,%ebp
test   $0x1,%bpl
je     1349 <kill_pppd_by_cmd+0x1a9>
movb   $0x20,0x3(%rsp,%rdi,1)
pshufd $0x55,%xmm1,%xmm1
movdqa %xmm5,%xmm2
pcmpgtb %xmm1,%xmm2
pextrw $0x4,%xmm2,%ebp
test   $0x1,%bpl
je     1366 <kill_pppd_by_cmd+0x1c6>
movb   $0x20,0x4(%rsp,%rdi,1)
movdqa %xmm0,%xmm1
pslldq $0x5,%xmm1
pextrw $0x5,%xmm1,%ebp
test   $0x1,%bpl
je     137f <kill_pppd_by_cmd+0x1df>
movb   $0x20,0x5(%rsp,%rdi,1)
pextrw $0x3,%xmm0,%ebp
test   $0x1,%bpl
je     138f <kill_pppd_by_cmd+0x1ef>
movb   $0x20,0x6(%rsp,%rdi,1)
pslldq $0x7,%xmm0
pextrw $0x7,%xmm0,%ebp
test   $0x1,%bpl
je     13a4 <kill_pppd_by_cmd+0x204>
movb   $0x20,0x7(%rsp,%rdi,1)
movq   0x8(%rsp,%rdi,1),%xmm1
movdqa %xmm4,%xmm0
pcmpgtb %xmm1,%xmm0
movd   %xmm0,%ebp
test   $0x1,%bpl
je     13c1 <kill_pppd_by_cmd+0x221>
movb   $0x20,0x8(%rsp,%rdi,1)
movdqa %xmm0,%xmm2
pslld  $0x8,%xmm2
movd   %xmm2,%ebp
shr    $0x10,%ebp
test   $0x1,%bpl
je     13dc <kill_pppd_by_cmd+0x23c>
movb   $0x20,0x9(%rsp,%rdi,1)
pshuflw $0x55,%xmm1,%xmm2
movdqa %xmm4,%xmm3
pcmpgtb %xmm2,%xmm3
pextrw $0x2,%xmm3,%ebp
test   $0x1,%bpl
je     13f9 <kill_pppd_by_cmd+0x259>
movb   $0x20,0xa(%rsp,%rdi,1)
movdqa %xmm0,%xmm2
psllq  $0x18,%xmm2
pextrw $0x3,%xmm2,%ebp
test   $0x1,%bpl
je     1412 <kill_pppd_by_cmd+0x272>
movb   $0x20,0xb(%rsp,%rdi,1)
pshufd $0x55,%xmm1,%xmm1
movdqa %xmm5,%xmm2
pcmpgtb %xmm1,%xmm2
pextrw $0x4,%xmm2,%ebp
test   $0x1,%bpl
je     142f <kill_pppd_by_cmd+0x28f>
movb   $0x20,0xc(%rsp,%rdi,1)
movdqa %xmm0,%xmm1
pslldq $0x5,%xmm1
pextrw $0x5,%xmm1,%ebp
test   $0x1,%bpl
je     1448 <kill_pppd_by_cmd+0x2a8>
movb   $0x20,0xd(%rsp,%rdi,1)
pextrw $0x3,%xmm0,%ebp
test   $0x1,%bpl
je     1458 <kill_pppd_by_cmd+0x2b8>
movb   $0x20,0xe(%rsp,%rdi,1)
pslldq $0x7,%xmm0
pextrw $0x7,%xmm0,%ebp
test   $0x1,%bpl
je     12d0 <kill_pppd_by_cmd+0x130>
movb   $0x20,0xf(%rsp,%rdi,1)
jmp    12d0 <kill_pppd_by_cmd+0x130>
cmp    %rsi,%rdx
jne    14b9 <kill_pppd_by_cmd+0x319>
movb   $0x0,(%rcx)
movd   0xa(%rsp),%xmm0
movd   %xmm0,%eax
cmp    $0x64707070,%eax
jne    1210 <kill_pppd_by_cmd+0x70>
lea    0xe(%rsp),%rdi
lea    0x80(%rsp),%rsi
call   10c0 <strstr@plt>
test   %rax,%rax
je     1210 <kill_pppd_by_cmd+0x70>
jmp    14c3 <kill_pppd_by_cmd+0x323>
add    $0x1,%rcx
add    $0xffffffff,%eax
je     147b <kill_pppd_by_cmd+0x2db>
cmpb   $0x1f,(%rcx)
jg     14b0 <kill_pppd_by_cmd+0x310>
movb   $0x20,(%rcx)
jmp    14b0 <kill_pppd_by_cmd+0x310>
mov    0x2b16(%rip),%rax
mov    (%rax),%esi
mov    %r14d,%edi
call   1070 <kill@plt>
mov    %rbx,%rdi
call   1050 <closedir@plt>
add    $0x108,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.dirent = type { i8* }
@.str = [6 x i8] c"/proc\00"
@.str.1 = [16 x i8] c"pppoe-session%d\00"
@.str.2 = [17 x i8] c"/proc/%d/cmdline\00"
@O_RDONLY = global i32 0
@SIGTERM = global i32 0
define void @kill_pppd_by_cmd(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32*
%5 = alloca %struct.dirent*
%6 = alloca i8*
%7 = alloca [64 x i8]
%8 = alloca [64 x i8]
%9 = alloca [128 x i8]
%10 = alloca i32
%11 = alloca i32
store i32 %0, i32* %2
%12 = call i32* @opendir(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
store i32* %12, i32** %4
%13 = icmp eq i32* %12, null
br i1 %13, label %14, label %15
14: ; preds = %1
br label %126
15: ; preds = %1
%16 = getelementptr inbounds [64 x i8], [64 x i8]* %7, i64 0, i64 0
%17 = load i32, i32* %2
%18 = add nsw i32 %17, 1
%19 = call i32 @sprintf(i8* %16, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %18)
br label %20
20: ; preds = %119, %113, %57, %51, %40, %15
%21 = load i32*, i32** %4
%22 = call %struct.dirent* @readdir(i32* %21)
store %struct.dirent* %22, %struct.dirent** %5
%23 = icmp eq %struct.dirent* %22, null
br i1 %23, label %24, label %27
24: ; preds = %20
%25 = load i32*, i32** %4
%26 = call i32 @closedir(i32* %25)
br label %126
27: ; preds = %20
%28 = load %struct.dirent*, %struct.dirent** %5
%29 = getelementptr inbounds %struct.dirent, %struct.dirent* %28, i32 0, i32 0
%30 = load i8*, i8** %29
store i8* %30, i8** %6
%31 = load i8*, i8** %6
%32 = load i8, i8* %31
%33 = sext i8 %32 to i32
%34 = icmp sge i32 %33, 48
br i1 %34, label %35, label %40
35: ; preds = %27
%36 = load i8*, i8** %6
%37 = load i8, i8* %36
%38 = sext i8 %37 to i32
%39 = icmp sle i32 %38, 57
br i1 %39, label %41, label %40
40: ; preds = %35, %27
br label %20
41: ; preds = %35
%42 = load i8*, i8** %6
%43 = call i32 @atoi(i8* %42)
store i32 %43, i32* %3
%44 = getelementptr inbounds [64 x i8], [64 x i8]* %8, i64 0, i64 0
%45 = load i32, i32* %3
%46 = call i32 @sprintf(i8* %44, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 %45)
%47 = getelementptr inbounds [64 x i8], [64 x i8]* %8, i64 0, i64 0
%48 = load i32, i32* @O_RDONLY
%49 = call i32 @open(i8* %47, i32 %48)
store i32 %49, i32* %10
%50 = icmp slt i32 %49, 0
br i1 %50, label %51, label %52
51: ; preds = %41
br label %20
52: ; preds = %41
%53 = load i32, i32* %10
%54 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 0
%55 = call i32 @read(i32 %53, i8* %54, i32 127)
store i32 %55, i32* %11
%56 = icmp slt i32 %55, 1
br i1 %56, label %57, label %60
57: ; preds = %52
%58 = load i32, i32* %10
%59 = call i32 @close(i32 %58)
br label %20
60: ; preds = %52
%61 = load i32, i32* %10
%62 = call i32 @close(i32 %61)
%63 = load i32, i32* %11
%64 = sub nsw i32 %63, 1
%65 = sext i32 %64 to i64
%66 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 %65
%67 = load i8, i8* %66
%68 = sext i8 %67 to i32
%69 = icmp eq i32 %68, 10
br i1 %69, label %70, label %75
70: ; preds = %60
%71 = load i32, i32* %11
%72 = add nsw i32 %71, -1
store i32 %72, i32* %11
%73 = sext i32 %72 to i64
%74 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 %73
store i8 0, i8* %74
br label %75
75: ; preds = %70, %60
%76 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 0
store i8* %76, i8** %6
br label %77
77: ; preds = %87, %75
%78 = load i32, i32* %11
%79 = icmp ne i32 %78, 0
br i1 %79, label %80, label %92
80: ; preds = %77
%81 = load i8*, i8** %6
%82 = load i8, i8* %81
%83 = sext i8 %82 to i32
%84 = icmp slt i32 %83, 32
br i1 %84, label %85, label %87
85: ; preds = %80
%86 = load i8*, i8** %6
store i8 32, i8* %86
br label %87
87: ; preds = %85, %80
%88 = load i8*, i8** %6
%89 = getelementptr inbounds i8, i8* %88, i32 1
store i8* %89, i8** %6
%90 = load i32, i32* %11
%91 = add nsw i32 %90, -1
store i32 %91, i32* %11
br label %77
92: ; preds = %77
%93 = load i8*, i8** %6
store i8 0, i8* %93
%94 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 10
%95 = load i8, i8* %94
%96 = sext i8 %95 to i32
%97 = icmp ne i32 %96, 112
br i1 %97, label %113, label %98
98: ; preds = %92
%99 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 11
%100 = load i8, i8* %99
%101 = sext i8 %100 to i32
%102 = icmp ne i32 %101, 112
br i1 %102, label %113, label %103
103: ; preds = %98
%104 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 12
%105 = load i8, i8* %104
%106 = sext i8 %105 to i32
%107 = icmp ne i32 %106, 112
br i1 %107, label %113, label %108
108: ; preds = %103
%109 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 13
%110 = load i8, i8* %109
%111 = sext i8 %110 to i32
%112 = icmp ne i32 %111, 100
br i1 %112, label %113, label %114
113: ; preds = %108, %103, %98, %92
br label %20
114: ; preds = %108
%115 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 14
%116 = getelementptr inbounds [64 x i8], [64 x i8]* %7, i64 0, i64 0
%117 = call i32* @strstr(i8* %115, i8* %116)
%118 = icmp eq i32* %117, null
br i1 %118, label %119, label %120
119: ; preds = %114
br label %20
120: ; preds = %114
%121 = load i32, i32* %3
%122 = load i32, i32* @SIGTERM
%123 = call i32 @kill(i32 %121, i32 %122)
%124 = load i32*, i32** %4
%125 = call i32 @closedir(i32* %124)
br label %126
126: ; preds = %120, %24, %14
ret void
}

LLVM IR (-O2):
%struct.dirent = type { i8* }
@.str = [6 x i8] c"/proc\00"
@.str.1 = [16 x i8] c"pppoe-session%d\00"
@.str.2 = [17 x i8] c"/proc/%d/cmdline\00"
@O_RDONLY = global i32 0
@SIGTERM = global i32 0
define void @kill_pppd_by_cmd(i32 %0) {
%2 = alloca [64 x i8]
%3 = alloca [64 x i8]
%4 = alloca [128 x i8]
%5 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%7 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 0
%8 = tail call i32* @opendir(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%9 = icmp eq i32* %8, null
br i1 %9, label %177, label %10
10: ; preds = %1
%11 = add nsw i32 %0, 1
%12 = call i32 @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %11)
%13 = call %struct.dirent* @readdir(i32* %8)
%14 = icmp eq %struct.dirent* %13, null
br i1 %14, label %175, label %15
15: ; preds = %10
%16 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 10
%17 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 14
%18 = bitcast i8* %16 to <4 x i8>*
br label %19
19: ; preds = %15, %36
%20 = phi %struct.dirent* [ %13, %15 ], [ %37, %36 ]
%21 = getelementptr inbounds %struct.dirent, %struct.dirent* %20, i64 0, i32 0
%22 = load i8*, i8** %21
%23 = load i8, i8* %22
%24 = add i8 %23, -48
%25 = icmp ult i8 %24, 10
br i1 %25, label %26, label %36
26: ; preds = %19
%27 = call i32 @atoi(i8* %22)
%28 = call i32 @sprintf(i8* %6, i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 %27)
%29 = load i32, i32* @O_RDONLY
%30 = call i32 @open(i8* %6, i32 %29)
%31 = icmp slt i32 %30, 0
br i1 %31, label %36, label %32
32: ; preds = %26
%33 = call i32 @read(i32 %30, i8* %7, i32 127)
%34 = icmp slt i32 %33, 1
%35 = call i32 @close(i32 %30)
br i1 %34, label %36, label %39
36: ; preds = %32, %19, %26, %163, %169
%37 = call %struct.dirent* @readdir(i32* %8)
%38 = icmp eq %struct.dirent* %37, null
br i1 %38, label %175, label %19
39: ; preds = %32
%40 = add nsw i32 %33, -1
%41 = zext i32 %40 to i64
%42 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 %41
%43 = load i8, i8* %42
%44 = icmp eq i8 %43, 10
br i1 %44, label %45, label %47
45: ; preds = %39
store i8 0, i8* %42
%46 = icmp eq i32 %40, 0
br i1 %46, label %163, label %47
47: ; preds = %39, %45
%48 = phi i32 [ %40, %45 ], [ %33, %39 ]
%49 = add i32 %48, -1
%50 = zext i32 %49 to i64
%51 = add nuw nsw i64 %50, 1
%52 = icmp ult i32 %49, 15
br i1 %52, label %150, label %53
53: ; preds = %47
%54 = and i64 %51, 8589934576
%55 = trunc i64 %54 to i32
%56 = sub i32 %48, %55
%57 = getelementptr [128 x i8], [128 x i8]* %4, i64 0, i64 %54
br label %58
58: ; preds = %145, %53
%59 = phi i64 [ 0, %53 ], [ %146, %145 ]
%60 = getelementptr [128 x i8], [128 x i8]* %4, i64 0, i64 %59
%61 = or i64 %59, 1
%62 = getelementptr [128 x i8], [128 x i8]* %4, i64 0, i64 %61
%63 = or i64 %59, 2
%64 = getelementptr [128 x i8], [128 x i8]* %4, i64 0, i64 %63
%65 = or i64 %59, 3
%66 = getelementptr [128 x i8], [128 x i8]* %4, i64 0, i64 %65
%67 = or i64 %59, 4
%68 = getelementptr [128 x i8], [128 x i8]* %4, i64 0, i64 %67
%69 = or i64 %59, 5
%70 = getelementptr [128 x i8], [128 x i8]* %4, i64 0, i64 %69
%71 = or i64 %59, 6
%72 = getelementptr [128 x i8], [128 x i8]* %4, i64 0, i64 %71
%73 = or i64 %59, 7
%74 = getelementptr [128 x i8], [128 x i8]* %4, i64 0, i64 %73
%75 = or i64 %59, 8
%76 = getelementptr [128 x i8], [128 x i8]* %4, i64 0, i64 %75
%77 = or i64 %59, 9
%78 = getelementptr [128 x i8], [128 x i8]* %4, i64 0, i64 %77
%79 = or i64 %59, 10
%80 = getelementptr [128 x i8], [128 x i8]* %4, i64 0, i64 %79
%81 = or i64 %59, 11
%82 = getelementptr [128 x i8], [128 x i8]* %4, i64 0, i64 %81
%83 = or i64 %59, 12
%84 = getelementptr [128 x i8], [128 x i8]* %4, i64 0, i64 %83
%85 = or i64 %59, 13
%86 = getelementptr [128 x i8], [128 x i8]* %4, i64 0, i64 %85
%87 = or i64 %59, 14
%88 = getelementptr [128 x i8], [128 x i8]* %4, i64 0, i64 %87
%89 = or i64 %59, 15
%90 = getelementptr [128 x i8], [128 x i8]* %4, i64 0, i64 %89
%91 = bitcast i8* %60 to <8 x i8>*
%92 = load <8 x i8>, <8 x i8>* %91
%93 = getelementptr i8, i8* %60, i64 8
%94 = bitcast i8* %93 to <8 x i8>*
%95 = load <8 x i8>, <8 x i8>* %94
%96 = icmp slt <8 x i8> %92, <i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32>
%97 = icmp slt <8 x i8> %95, <i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32>
%98 = extractelement <8 x i1> %96, i64 0
br i1 %98, label %99, label %100
99: ; preds = %58
store i8 32, i8* %60
br label %100
100: ; preds = %99, %58
%101 = extractelement <8 x i1> %96, i64 1
br i1 %101, label %102, label %103
102: ; preds = %100
store i8 32, i8* %62
br label %103
103: ; preds = %102, %100
%104 = extractelement <8 x i1> %96, i64 2
br i1 %104, label %105, label %106
105: ; preds = %103
store i8 32, i8* %64
br label %106
106: ; preds = %105, %103
%107 = extractelement <8 x i1> %96, i64 3
br i1 %107, label %108, label %109
108: ; preds = %106
store i8 32, i8* %66
br label %109
109: ; preds = %108, %106
%110 = extractelement <8 x i1> %96, i64 4
br i1 %110, label %111, label %112
111: ; preds = %109
store i8 32, i8* %68
br label %112
112: ; preds = %111, %109
%113 = extractelement <8 x i1> %96, i64 5
br i1 %113, label %114, label %115
114: ; preds = %112
store i8 32, i8* %70
br label %115
115: ; preds = %114, %112
%116 = extractelement <8 x i1> %96, i64 6
br i1 %116, label %117, label %118
117: ; preds = %115
store i8 32, i8* %72
br label %118
118: ; preds = %117, %115
%119 = extractelement <8 x i1> %96, i64 7
br i1 %119, label %120, label %121
120: ; preds = %118
store i8 32, i8* %74
br label %121
121: ; preds = %120, %118
%122 = extractelement <8 x i1> %97, i64 0
br i1 %122, label %123, label %124
123: ; preds = %121
store i8 32, i8* %76
br label %124
124: ; preds = %123, %121
%125 = extractelement <8 x i1> %97, i64 1
br i1 %125, label %126, label %127
126: ; preds = %124
store i8 32, i8* %78
br label %127
127: ; preds = %126, %124
%128 = extractelement <8 x i1> %97, i64 2
br i1 %128, label %129, label %130
129: ; preds = %127
store i8 32, i8* %80
br label %130
130: ; preds = %129, %127
%131 = extractelement <8 x i1> %97, i64 3
br i1 %131, label %132, label %133
132: ; preds = %130
store i8 32, i8* %82
br label %133
133: ; preds = %132, %130
%134 = extractelement <8 x i1> %97, i64 4
br i1 %134, label %135, label %136
135: ; preds = %133
store i8 32, i8* %84
br label %136
136: ; preds = %135, %133
%137 = extractelement <8 x i1> %97, i64 5
br i1 %137, label %138, label %139
138: ; preds = %136
store i8 32, i8* %86
br label %139
139: ; preds = %138, %136
%140 = extractelement <8 x i1> %97, i64 6
br i1 %140, label %141, label %142
141: ; preds = %139
store i8 32, i8* %88
br label %142
142: ; preds = %141, %139
%143 = extractelement <8 x i1> %97, i64 7
br i1 %143, label %144, label %145
144: ; preds = %142
store i8 32, i8* %90
br label %145
145: ; preds = %144, %142
%146 = add nuw i64 %59, 16
%147 = icmp eq i64 %146, %54
br i1 %147, label %148, label %58
148: ; preds = %145
%149 = icmp eq i64 %51, %54
br i1 %149, label %163, label %150
150: ; preds = %47, %148
%151 = phi i32 [ %48, %47 ], [ %56, %148 ]
%152 = phi i8* [ %7, %47 ], [ %57, %148 ]
br label %153
153: ; preds = %150, %159
%154 = phi i32 [ %161, %159 ], [ %151, %150 ]
%155 = phi i8* [ %160, %159 ], [ %152, %150 ]
%156 = load i8, i8* %155
%157 = icmp slt i8 %156, 32
br i1 %157, label %158, label %159
158: ; preds = %153
store i8 32, i8* %155
br label %159
159: ; preds = %158, %153
%160 = getelementptr inbounds i8, i8* %155, i64 1
%161 = add nsw i32 %154, -1
%162 = icmp eq i32 %161, 0
br i1 %162, label %163, label %153
163: ; preds = %159, %148, %45
%164 = phi i8* [ %7, %45 ], [ %57, %148 ], [ %160, %159 ]
store i8 0, i8* %164
%165 = load <4 x i8>, <4 x i8>* %18
%166 = freeze <4 x i8> %165
%167 = bitcast <4 x i8> %166 to i32
%168 = icmp eq i32 %167, 1685090416
br i1 %168, label %169, label %36
169: ; preds = %163
%170 = call i32* @strstr(i8* %17, i8* %5)
%171 = icmp eq i32* %170, null
br i1 %171, label %36, label %172
172: ; preds = %169
%173 = load i32, i32* @SIGTERM
%174 = call i32 @kill(i32 %27, i32 %173)
br label %175
175: ; preds = %36, %10, %172
%176 = call i32 @closedir(i32* %8)
br label %177
177: ; preds = %175, %1
ret void
}