#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 */
scalar_t__ EPERM;
int atoi(char *);
scalar_t__ errno;
int execlp(char *, char *, char *, char *, void *);
int findPid(char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int kill(int, int);
int /*<<< orphan*/ snprintf(char *, int, char *, int, int);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
char *strerror(scalar_t__);
int /*<<< orphan*/ strncpy(char *, char *, int);
int /*<<< orphan*/ usage();
int main(int argc, char **argv) {
  int pid = -1;
  char progname[128] = {0};
  int signal_number = -1, i, list_only = 0;
  for (i = 1; i < argc; i++) {
    if (argv[i][0] != '-') {
      usage();
      return (-1);
    }
    switch (argv[i][1]) {
    case 'p':
      strncpy(progname, argv[++i], 128);
      progname[127] = '\0';
      break;
    case 's':
      signal_number = atoi(argv[++i]);
      break;
    case 'l':
      list_only = 1;
      break;
    default:
      usage();
      return -1;
    }
  }
  if (progname[0] == 0) {
    usage();
    return -1;
  }
  pid = findPid(progname);
  if (pid == -1) {
    fprintf(stderr, "no such program: %s\n", progname);
    return -1;
  }
  if (list_only) {
    fprintf(stdout, "PID: %d\n", pid);
    return 0;
  }
  if (signal_number != -1) {
    int result;
    result = kill(pid, signal_number);
    if (result == -1) {
      if (errno == EPERM) {
        char buf[256];
        fprintf(stderr, "operation not authorized, switching to root\n");
        snprintf(buf, 256, "kill -%d %d", signal_number, pid);
        if (execlp("tdesu", "tdesu", "-c", buf, (void *)0) == -1) {
          fprintf(stderr, "operation failed: %s\n", strerror(errno));
          return -1;
        }
      } else {
        fprintf(stderr,
                "operation failed (invalid signal or no such process)\n");
        return -1;
      }
    }
  } else {
    fprintf(stderr, "only signal sending is currently supported\n");
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1c0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xffffffff,-0x14(%rbp)
lea    -0xa0(%rbp),%rdi
xor    %esi,%esi
mov    $0x80,%edx
call   1050 <memset@plt>
movl   $0xffffffff,-0xa4(%rbp)
ff ff ff
movl   $0x0,-0xac(%rbp)
movl   $0x1,-0xa8(%rbp)
mov    -0xa8(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1316 <main+0x176>
mov    -0x10(%rbp),%rax
movslq -0xa8(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
je     122e <main+0x8e>
mov    $0x0,%al
call   1080 <usage@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    14f8 <main+0x358>
mov    -0x10(%rbp),%rax
movslq -0xa8(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsbl 0x1(%rax),%eax
mov    %eax,-0x1b4(%rbp)
sub    $0x6c,%eax
je     12db <main+0x13b>
jmp    1255 <main+0xb5>
mov    -0x1b4(%rbp),%eax
sub    $0x70,%eax
je     127d <main+0xdd>
jmp    1269 <main+0xc9>
mov    -0x1b4(%rbp),%eax
sub    $0x73,%eax
je     12b1 <main+0x111>
jmp    12ea <main+0x14a>
lea    -0xa0(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    -0xa8(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0xa8(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rsi
mov    $0x80,%edx
call   1030 <strncpy@plt>
movb   $0x0,-0x21(%rbp)
jmp    12fd <main+0x15d>
mov    -0x10(%rbp),%rax
mov    -0xa8(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0xa8(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
call   1090 <atoi@plt>
mov    %eax,-0xa4(%rbp)
jmp    12fd <main+0x15d>
movl   $0x1,-0xac(%rbp)
jmp    12fd <main+0x15d>
mov    $0x0,%al
call   1080 <usage@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    14f8 <main+0x358>
jmp    1302 <main+0x162>
mov    -0xa8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa8(%rbp)
jmp    11f1 <main+0x51>
movsbl -0xa0(%rbp),%eax
cmp    $0x0,%eax
jne    1339 <main+0x199>
mov    $0x0,%al
call   1080 <usage@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    14f8 <main+0x358>
lea    -0xa0(%rbp),%rdi
call   10a0 <findPid@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
jne    137c <main+0x1dc>
mov    0x2c87(%rip),%rax
mov    (%rax),%edi
lea    -0xa0(%rbp),%rdx
lea    0xc97(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    14f8 <main+0x358>
cmpl   $0x0,-0xac(%rbp)
je     13af <main+0x20f>
mov    0x2c40(%rip),%rax
mov    (%rax),%edi
mov    -0x14(%rbp),%edx
lea    0xc79(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    14f8 <main+0x358>
cmpl   $0xffffffff,-0xa4(%rbp)
je     14ce <main+0x32e>
mov    -0x14(%rbp),%edi
mov    -0xa4(%rbp),%esi
call   1070 <kill@plt>
mov    %eax,-0xb0(%rbp)
cmpl   $0xffffffff,-0xb0(%rbp)
jne    14c9 <main+0x329>
mov    0x2bf4(%rip),%rax
mov    (%rax),%rax
mov    0x2bd2(%rip),%rcx
cmp    (%rcx),%rax
jne    14a1 <main+0x301>
mov    0x2be2(%rip),%rax
mov    (%rax),%edi
lea    0xc17(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
lea    -0x1b0(%rbp),%rdi
mov    -0xa4(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    $0x100,%esi
lea    0xc20(%rip),%rdx
call   1040 <snprintf@plt>
lea    -0x1b0(%rbp),%rcx
lea    0xc19(%rip),%rsi
lea    0xc18(%rip),%rdx
xor    %eax,%eax
mov    %eax,%r8d
mov    %rsi,%rdi
call   10b0 <execlp@plt>
cmp    $0xffffffff,%eax
jne    149c <main+0x2fc>
mov    0x2b7e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1b8(%rbp)
mov    0x2b67(%rip),%rax
mov    (%rax),%rdi
call   10c0 <strerror@plt>
mov    -0x1b8(%rbp),%edi
mov    %rax,%rdx
lea    0xbd7(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    14f8 <main+0x358>
jmp    14c4 <main+0x324>
mov    0x2b38(%rip),%rax
mov    (%rax),%edi
lea    0xbc5(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    14f8 <main+0x358>
jmp    14c9 <main+0x329>
jmp    14f1 <main+0x351>
mov    0x2b0b(%rip),%rax
mov    (%rax),%edi
lea    0xbce(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    14f8 <main+0x358>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1c0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x188,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
cmp    $0x2,%edi
jl     128f <main+0xff>
mov    %rsi,%rbx
mov    %edi,%r13d
mov    $0xffffffff,%r14d
mov    $0x1,%ebp
xor    %r12d,%r12d
mov    %rsp,%r15
jmp    1208 <main+0x78>
nopl   (%rax)
lea    0x1(%rax),%ebp
mov    0x8(%rbx,%rax,8),%rdi
call   1080 <atoi@plt>
mov    %eax,%r14d
add    $0x1,%ebp
cmp    %r13d,%ebp
jge    1258 <main+0xc8>
movslq %ebp,%rax
mov    (%rbx,%rax,8),%rcx
cmpb   $0x2d,(%rcx)
jne    128f <main+0xff>
movsbl 0x1(%rcx),%ecx
cmp    $0x6c,%ecx
je     1250 <main+0xc0>
cmp    $0x73,%ecx
je     11f0 <main+0x60>
cmp    $0x70,%ecx
jne    128f <main+0xff>
lea    0x1(%rax),%ebp
mov    0x8(%rbx,%rax,8),%rsi
mov    %r15,%rdi
mov    $0x80,%edx
call   1030 <strncpy@plt>
movb   $0x0,0x7f(%rsp)
jmp    1200 <main+0x70>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    $0x1,%r12d
jmp    1200 <main+0x70>
cmpb   $0x0,(%rsp)
je     128f <main+0xff>
mov    %rsp,%rdi
call   1090 <findPid@plt>
cmp    $0xffffffff,%eax
je     12af <main+0x11f>
mov    %eax,%ebp
test   %r12d,%r12d
je     12cb <main+0x13b>
mov    0x2d57(%rip),%rax
mov    (%rax),%edi
lea    0xd93(%rip),%rsi
xor    %ebx,%ebx
mov    %ebp,%edx
xor    %eax,%eax
call   1050 <fprintf@plt>
jmp    129b <main+0x10b>
xor    %eax,%eax
call   1070 <usage@plt>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
add    $0x188,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2d2a(%rip),%rax
mov    (%rax),%edi
lea    0xd41(%rip),%rsi
mov    %rsp,%rdx
xor    %eax,%eax
call   1050 <fprintf@plt>
jmp    1296 <main+0x106>
cmp    $0xffffffff,%r14d
je     1381 <main+0x1f1>
mov    %ebp,%edi
mov    %r14d,%esi
call   1060 <kill@plt>
xor    %ebx,%ebx
cmp    $0xffffffff,%eax
jne    129b <main+0x10b>
mov    0x2ceb(%rip),%r12
mov    (%r12),%rax
mov    0x2cc8(%rip),%rcx
cmp    (%rcx),%rax
jne    1393 <main+0x203>
mov    0x2cd8(%rip),%r13
mov    0x0(%r13),%edi
lea    0xd0b(%rip),%rsi
xor    %ebx,%ebx
xor    %eax,%eax
call   1050 <fprintf@plt>
lea    0xd28(%rip),%rdx
lea    0x80(%rsp),%r15
mov    %r15,%rdi
mov    $0x100,%esi
mov    %r14d,%ecx
mov    %ebp,%r8d
call   1040 <snprintf@plt>
lea    0xd12(%rip),%rdi
lea    0xd11(%rip),%rdx
mov    %rdi,%rsi
mov    %r15,%rcx
xor    %r8d,%r8d
call   10a0 <execlp@plt>
cmp    $0xffffffff,%eax
jne    129b <main+0x10b>
mov    0x0(%r13),%ebx
mov    (%r12),%rdi
call   10b0 <strerror@plt>
lea    0xce9(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
jmp    12c2 <main+0x132>
mov    0x2c58(%rip),%rax
mov    (%rax),%edi
lea    0xd1b(%rip),%rsi
jmp    13a3 <main+0x213>
mov    0x2c46(%rip),%rax
mov    (%rax),%edi
lea    0xcd3(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
jmp    1296 <main+0x106>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [21 x i8] c"no such program: %s\0A\00"
@stdout = global i32 0
@.str.1 = [9 x i8] c"PID: %d\0A\00"
@errno = global i64 0
@EPERM = global i64 0
@.str.2 = [45 x i8] c"operation not authorized, switching to root\0A\00"
@.str.3 = [12 x i8] c"kill -%d %d\00"
@.str.4 = [6 x i8] c"tdesu\00"
@.str.5 = [3 x i8] c"-c\00"
@.str.6 = [22 x i8] c"operation failed: %s\0A\00"
@.str.7 = [54 x i8] c"operation failed (invalid signal or no such process)\0A\00"
@.str.8 = [44 x i8] c"only signal sending is currently supported\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca [128 x i8]
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca [256 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 -1, i32* %6
%13 = bitcast [128 x i8]* %7 to i8*
store i32 -1, i32* %8
store i32 0, i32* %10
store i32 1, i32* %9
br label %14
14: ; preds = %61, %2
%15 = load i32, i32* %9
%16 = load i32, i32* %4
%17 = icmp slt i32 %15, %16
br i1 %17, label %18, label %64
18: ; preds = %14
%19 = load i8**, i8*** %5
%20 = load i32, i32* %9
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i8*, i8** %19, i64 %21
%23 = load i8*, i8** %22
%24 = getelementptr inbounds i8, i8* %23, i64 0
%25 = load i8, i8* %24
%26 = sext i8 %25 to i32
%27 = icmp ne i32 %26, 45
br i1 %27, label %28, label %30
28: ; preds = %18
%29 = call i32 (...) @usage()
store i32 -1, i32* %3
br label %125
30: ; preds = %18
%31 = load i8**, i8*** %5
%32 = load i32, i32* %9
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds i8*, i8** %31, i64 %33
%35 = load i8*, i8** %34
%36 = getelementptr inbounds i8, i8* %35, i64 1
%37 = load i8, i8* %36
%38 = sext i8 %37 to i32
switch i32 %38, label %58 [
i32 112, label %39
i32 115, label %49
i32 108, label %57
]
39: ; preds = %30
%40 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%41 = load i8**, i8*** %5
%42 = load i32, i32* %9
%43 = add nsw i32 %42, 1
store i32 %43, i32* %9
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds i8*, i8** %41, i64 %44
%46 = load i8*, i8** %45
%47 = call i32 @strncpy(i8* %40, i8* %46, i32 128)
%48 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 127
store i8 0, i8* %48
br label %60
49: ; preds = %30
%50 = load i8**, i8*** %5
%51 = load i32, i32* %9
%52 = add nsw i32 %51, 1
store i32 %52, i32* %9
%53 = sext i32 %52 to i64
%54 = getelementptr inbounds i8*, i8** %50, i64 %53
%55 = load i8*, i8** %54
%56 = call i32 @atoi(i8* %55)
store i32 %56, i32* %8
br label %60
57: ; preds = %30
store i32 1, i32* %10
br label %60
58: ; preds = %30
%59 = call i32 (...) @usage()
store i32 -1, i32* %3
br label %125
60: ; preds = %57, %49, %39
br label %61
61: ; preds = %60
%62 = load i32, i32* %9
%63 = add nsw i32 %62, 1
store i32 %63, i32* %9
br label %14
64: ; preds = %14
%65 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%66 = load i8, i8* %65
%67 = sext i8 %66 to i32
%68 = icmp eq i32 %67, 0
br i1 %68, label %69, label %71
69: ; preds = %64
%70 = call i32 (...) @usage()
store i32 -1, i32* %3
br label %125
71: ; preds = %64
%72 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%73 = call i32 @findPid(i8* %72)
store i32 %73, i32* %6
%74 = load i32, i32* %6
%75 = icmp eq i32 %74, -1
br i1 %75, label %76, label %80
76: ; preds = %71
%77 = load i32, i32* @stderr
%78 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%79 = call i32 (i32, i8*, ...) @fprintf(i32 %77, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %78)
store i32 -1, i32* %3
br label %125
80: ; preds = %71
%81 = load i32, i32* %10
%82 = icmp ne i32 %81, 0
br i1 %82, label %83, label %87
83: ; preds = %80
%84 = load i32, i32* @stdout
%85 = load i32, i32* %6
%86 = call i32 (i32, i8*, ...) @fprintf(i32 %84, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %85)
store i32 0, i32* %3
br label %125
87: ; preds = %80
%88 = load i32, i32* %8
%89 = icmp ne i32 %88, -1
br i1 %89, label %90, label %121
90: ; preds = %87
%91 = load i32, i32* %6
%92 = load i32, i32* %8
%93 = call i32 @kill(i32 %91, i32 %92)
store i32 %93, i32* %11
%94 = load i32, i32* %11
%95 = icmp eq i32 %94, -1
br i1 %95, label %96, label %120
96: ; preds = %90
%97 = load i64, i64* @errno
%98 = load i64, i64* @EPERM
%99 = icmp eq i64 %97, %98
br i1 %99, label %100, label %116
100: ; preds = %96
%101 = load i32, i32* @stderr
%102 = call i32 (i32, i8*, ...) @fprintf(i32 %101, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.2, i64 0, i64 0))
%103 = getelementptr inbounds [256 x i8], [256 x i8]* %12, i64 0, i64 0
%104 = load i32, i32* %8
%105 = load i32, i32* %6
%106 = call i32 @snprintf(i8* %103, i32 256, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 %104, i32 %105)
%107 = getelementptr inbounds [256 x i8], [256 x i8]* %12, i64 0, i64 0
%108 = call i32 @execlp(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %107, i8* null)
%109 = icmp eq i32 %108, -1
br i1 %109, label %110, label %115
110: ; preds = %100
%111 = load i32, i32* @stderr
%112 = load i64, i64* @errno
%113 = call i8* @strerror(i64 %112)
%114 = call i32 (i32, i8*, ...) @fprintf(i32 %111, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.6, i64 0, i64 0), i8* %113)
store i32 -1, i32* %3
br label %125
115: ; preds = %100
br label %119
116: ; preds = %96
%117 = load i32, i32* @stderr
%118 = call i32 (i32, i8*, ...) @fprintf(i32 %117, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.7, i64 0, i64 0))
store i32 -1, i32* %3
br label %125
119: ; preds = %115
br label %120
120: ; preds = %119, %90
br label %124
121: ; preds = %87
%122 = load i32, i32* @stderr
%123 = call i32 (i32, i8*, ...) @fprintf(i32 %122, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.8, i64 0, i64 0))
store i32 -1, i32* %3
br label %125
124: ; preds = %120
store i32 0, i32* %3
br label %125
125: ; preds = %124, %121, %116, %110, %83, %76, %69, %58, %28
%126 = load i32, i32* %3
ret i32 %126
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [21 x i8] c"no such program: %s\0A\00"
@stdout = global i32 0
@.str.1 = [9 x i8] c"PID: %d\0A\00"
@errno = global i64 0
@EPERM = global i64 0
@.str.2 = [45 x i8] c"operation not authorized, switching to root\0A\00"
@.str.3 = [12 x i8] c"kill -%d %d\00"
@.str.4 = [6 x i8] c"tdesu\00"
@.str.5 = [3 x i8] c"-c\00"
@.str.6 = [22 x i8] c"operation failed: %s\0A\00"
@.str.7 = [54 x i8] c"operation failed (invalid signal or no such process)\0A\00"
@.str.8 = [44 x i8] c"only signal sending is currently supported\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [128 x i8]
%4 = alloca [256 x i8]
%5 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%6 = icmp sgt i32 %0, 1
br i1 %6, label %7, label %47
7: ; preds = %2
%8 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 127
br label %9
9: ; preds = %7, %38
%10 = phi i32 [ 0, %7 ], [ %41, %38 ]
%11 = phi i32 [ 1, %7 ], [ %42, %38 ]
%12 = phi i32 [ -1, %7 ], [ %39, %38 ]
%13 = sext i32 %11 to i64
%14 = getelementptr inbounds i8*, i8** %1, i64 %13
%15 = load i8*, i8** %14
%16 = load i8, i8* %15
%17 = icmp eq i8 %16, 45
br i1 %17, label %20, label %18
18: ; preds = %9
%19 = call i32 (...) @usage()
br label %88
20: ; preds = %9
%21 = getelementptr inbounds i8, i8* %15, i64 1
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
switch i32 %23, label %36 [
i32 112, label %24
i32 115, label %30
i32 108, label %38
]
24: ; preds = %20
%25 = add nsw i32 %11, 1
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds i8*, i8** %1, i64 %26
%28 = load i8*, i8** %27
%29 = call i32 @strncpy(i8* %5, i8* %28, i32 128)
store i8 0, i8* %8
br label %38
30: ; preds = %20
%31 = add nsw i32 %11, 1
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds i8*, i8** %1, i64 %32
%34 = load i8*, i8** %33
%35 = call i32 @atoi(i8* %34)
br label %38
36: ; preds = %20
%37 = call i32 (...) @usage()
br label %88
38: ; preds = %20, %24, %30
%39 = phi i32 [ %35, %30 ], [ %12, %24 ], [ %12, %20 ]
%40 = phi i32 [ %31, %30 ], [ %25, %24 ], [ %11, %20 ]
%41 = phi i32 [ %10, %30 ], [ %10, %24 ], [ 1, %20 ]
%42 = add nsw i32 %40, 1
%43 = icmp slt i32 %42, %0
br i1 %43, label %9, label %44
44: ; preds = %38
%45 = load i8, i8* %5
%46 = icmp eq i8 %45, 0
br i1 %46, label %47, label %49
47: ; preds = %2, %44
%48 = call i32 (...) @usage()
br label %88
49: ; preds = %44
%50 = call i32 @findPid(i8* %5)
%51 = icmp eq i32 %50, -1
br i1 %51, label %52, label %55
52: ; preds = %49
%53 = load i32, i32* @stderr
%54 = call i32 (i32, i8*, ...) @fprintf(i32 %53, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %5)
br label %88
55: ; preds = %49
%56 = icmp eq i32 %41, 0
br i1 %56, label %60, label %57
57: ; preds = %55
%58 = load i32, i32* @stdout
%59 = call i32 (i32, i8*, ...) @fprintf(i32 %58, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %50)
br label %88
60: ; preds = %55
%61 = icmp eq i32 %39, -1
br i1 %61, label %85, label %62
62: ; preds = %60
%63 = call i32 @kill(i32 %50, i32 %39)
%64 = icmp eq i32 %63, -1
br i1 %64, label %65, label %88
65: ; preds = %62
%66 = load i64, i64* @errno
%67 = load i64, i64* @EPERM
%68 = icmp eq i64 %66, %67
br i1 %68, label %69, label %82
69: ; preds = %65
%70 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%71 = load i32, i32* @stderr
%72 = call i32 (i32, i8*, ...) @fprintf(i32 %71, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.2, i64 0, i64 0))
%73 = call i32 @snprintf(i8* %70, i32 256, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 %39, i32 %50)
%74 = call i32 @execlp(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %70, i8* null)
%75 = icmp eq i32 %74, -1
br i1 %75, label %76, label %81
76: ; preds = %69
%77 = load i32, i32* @stderr
%78 = load i64, i64* @errno
%79 = call i8* @strerror(i64 %78)
%80 = call i32 (i32, i8*, ...) @fprintf(i32 %77, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.6, i64 0, i64 0), i8* %79)
br label %88
81: ; preds = %69
br label %88
82: ; preds = %65
%83 = load i32, i32* @stderr
%84 = call i32 (i32, i8*, ...) @fprintf(i32 %83, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.7, i64 0, i64 0))
br label %88
85: ; preds = %60
%86 = load i32, i32* @stderr
%87 = call i32 (i32, i8*, ...) @fprintf(i32 %86, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.8, i64 0, i64 0))
br label %88
88: ; preds = %76, %82, %81, %62, %85, %57, %52, %47, %36, %18
%89 = phi i32 [ -1, %18 ], [ -1, %36 ], [ -1, %47 ], [ -1, %52 ], [ 0, %57 ], [ -1, %85 ], [ -1, %82 ], [ -1, %76 ], [ 0, %81 ], [ 0, %62 ]
ret i32 %89
}