#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*/ pid_t;

/* Variables and functions */
int SIGTERM;
int /*<<< orphan*/ display_kill_version();
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ kill(int /*<<< orphan*/, int);
int /*<<< orphan*/ kill_usage();
int /*<<< orphan*/ pretty_print_signals();
int print_given_signals(int, char **, int);
int signal_name_to_number(char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strcmp(char *, char *);
long strtol(char *, char **, int);
int /*<<< orphan*/ unix_print_signals();
void kill_main(int argc, char *argv[]) {
  char *sigptr;
  int signo = SIGTERM;
  int exitvalue = 0;
  if (argc < 2)
    kill_usage();
  if (!strcmp(argv[1], "-V") || !strcmp(argv[1], "--version")) {
    display_kill_version();
    exit(0);
  }
  if (argv[1][0] != '-') {
    argv++;
    argc--;
    goto no_more_args;
  }
  if (argv[1][1] == 'l' && argv[1][2] == '\0') {
    if (argc == 2) {
      unix_print_signals();
      exit(0);
    }
    if (argc > 128 || argv[2][0] == '-')
      kill_usage();
    exit(print_given_signals(argc - 2, argv + 2, 80));
  }
  if (argv[1][1] == 'L' && argv[1][2] == '\0') {
    if (argc == 2) {
      pretty_print_signals();
      exit(0);
    }
    kill_usage();
  }
  if (argv[1][1] == '-' && argv[1][2] == '\0') {
    argv += 2;
    argc -= 2;
    goto no_more_args;
  }
  if (argv[1][1] == '-')
    kill_usage();
  if (argv[1][1] == 's' && argv[1][2] == '\0') {
    sigptr = argv[2];
    argv += 3;
    argc -= 3;
  } else {
    sigptr = argv[1] + 1;
    argv += 2;
    argc -= 2;
  }
  signo = signal_name_to_number(sigptr);
  if (signo < 0) {
    fprintf(stderr, "ERROR: unknown signal name \"%s\".\n", sigptr);
    kill_usage();
  }
no_more_args:
  if (!argc)
    kill_usage();
  while (argc--) {
    long pid;
    char *endp;
    pid = strtol(argv[argc], &endp, 10);
    if (!*endp) {
      if (!kill((pid_t)pid, signo))
        continue;
      exitvalue = 1;
      continue;
    }
    fprintf(stderr, "ERROR: garbage process ID \"%s\".\n", argv[argc]);
    kill_usage();
  }
  exit(exitvalue);
}


x86 assembly (clang, -O0):
<kill_main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e22(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
cmpl   $0x2,-0x4(%rbp)
jge    11e3 <kill_main+0x33>
mov    $0x0,%al
call   1050 <kill_usage@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe0e(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
je     121d <kill_main+0x6d>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xdf4(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    122b <kill_main+0x7b>
mov    $0x0,%al
call   1030 <display_kill_version@plt>
xor    %edi,%edi
call   10c0 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
je     1259 <kill_main+0xa9>
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    143b <kill_main+0x28b>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsbl 0x1(%rax),%eax
cmp    $0x6c,%eax
jne    12e2 <kill_main+0x132>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsbl 0x2(%rax),%eax
cmp    $0x0,%eax
jne    12e2 <kill_main+0x132>
cmpl   $0x2,-0x4(%rbp)
jne    129b <kill_main+0xeb>
mov    $0x0,%al
call   10d0 <unix_print_signals@plt>
xor    %edi,%edi
call   10c0 <exit@plt>
cmpl   $0x80,-0x4(%rbp)
jg     12bc <kill_main+0x10c>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    12c3 <kill_main+0x113>
mov    $0x0,%al
call   1050 <kill_usage@plt>
mov    -0x4(%rbp),%edi
sub    $0x2,%edi
mov    -0x10(%rbp),%rsi
add    $0x10,%rsi
mov    $0x50,%edx
call   10a0 <print_given_signals@plt>
mov    %eax,%edi
call   10c0 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsbl 0x1(%rax),%eax
cmp    $0x4c,%eax
jne    132b <kill_main+0x17b>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsbl 0x2(%rax),%eax
cmp    $0x0,%eax
jne    132b <kill_main+0x17b>
cmpl   $0x2,-0x4(%rbp)
jne    1324 <kill_main+0x174>
mov    $0x0,%al
call   10b0 <pretty_print_signals@plt>
xor    %edi,%edi
call   10c0 <exit@plt>
mov    $0x0,%al
call   1050 <kill_usage@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsbl 0x1(%rax),%eax
cmp    $0x2d,%eax
jne    136f <kill_main+0x1bf>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsbl 0x2(%rax),%eax
cmp    $0x0,%eax
jne    136f <kill_main+0x1bf>
mov    -0x10(%rbp),%rax
add    $0x10,%rax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x2,%eax
mov    %eax,-0x4(%rbp)
jmp    143b <kill_main+0x28b>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsbl 0x1(%rax),%eax
cmp    $0x2d,%eax
jne    138b <kill_main+0x1db>
mov    $0x0,%al
call   1050 <kill_usage@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsbl 0x1(%rax),%eax
cmp    $0x73,%eax
jne    13db <kill_main+0x22b>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsbl 0x2(%rax),%eax
cmp    $0x0,%eax
jne    13db <kill_main+0x22b>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    $0x18,%rax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x3,%eax
mov    %eax,-0x4(%rbp)
jmp    1400 <kill_main+0x250>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x2,%eax
mov    %eax,-0x4(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <signal_name_to_number@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jge    1436 <kill_main+0x286>
mov    0x2bbb(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
lea    0xbe3(%rip),%rsi
call   1070 <fprintf@plt>
mov    $0x0,%al
call   1050 <kill_usage@plt>
jmp    143b <kill_main+0x28b>
cmpl   $0x0,-0x4(%rbp)
jne    144c <kill_main+0x29c>
mov    $0x0,%al
call   1050 <kill_usage@plt>
jmp    1451 <kill_main+0x2a1>
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
je     14e5 <kill_main+0x335>
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    -0x30(%rbp),%rsi
mov    $0xa,%edx
call   1080 <strtol@plt>
mov    %rax,-0x28(%rbp)
mov    -0x30(%rbp),%rax
cmpb   $0x0,(%rax)
jne    14b8 <kill_main+0x308>
mov    -0x28(%rbp),%rax
mov    %eax,%edi
mov    -0x1c(%rbp),%esi
call   1090 <kill@plt>
cmp    $0x0,%eax
jne    14ac <kill_main+0x2fc>
jmp    1451 <kill_main+0x2a1>
movl   $0x1,-0x20(%rbp)
jmp    1451 <kill_main+0x2a1>
mov    0x2b19(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xb5b(%rip),%rsi
call   1070 <fprintf@plt>
mov    $0x0,%al
call   1050 <kill_usage@plt>
jmp    1451 <kill_main+0x2a1>
mov    -0x20(%rbp),%edi
call   10c0 <exit@plt>

x86 assembly (clang, -O2):
<kill_main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%r14
mov    %edi,%r15d
mov    0x2e1d(%rip),%rax
mov    (%rax),%eax
mov    %eax,0xc(%rsp)
cmp    $0x1,%edi
jg     11dd <kill_main+0x2d>
xor    %eax,%eax
call   1050 <kill_usage@plt>
mov    0x8(%r14),%rbp
lea    0xe18(%rip),%rsi
mov    %rbp,%rdi
call   1060 <strcmp@plt>
test   %eax,%eax
je     1207 <kill_main+0x57>
lea    0xe08(%rip),%rsi
mov    %rbp,%rdi
call   1060 <strcmp@plt>
test   %eax,%eax
jne    1215 <kill_main+0x65>
xor    %eax,%eax
call   1030 <display_kill_version@plt>
xor    %edi,%edi
call   10c0 <exit@plt>
lea    0x8(%r14),%rbx
cmpb   $0x2d,0x0(%rbp)
jne    1248 <kill_main+0x98>
mov    0x1(%rbp),%al
cmp    $0x4c,%al
je     1254 <kill_main+0xa4>
cmp    $0x6c,%al
jne    12c8 <kill_main+0x118>
cmpb   $0x0,0x2(%rbp)
jne    126e <kill_main+0xbe>
cmp    $0x2,%r15d
jne    1285 <kill_main+0xd5>
xor    %eax,%eax
call   10d0 <unix_print_signals@plt>
xor    %edi,%edi
call   10c0 <exit@plt>
add    $0xffffffff,%r15d
mov    %r15d,%r13d
jmp    134d <kill_main+0x19d>
cmpb   $0x0,0x2(%rbp)
jne    126e <kill_main+0xbe>
xor    %eax,%eax
cmp    $0x2,%r15d
jne    12bd <kill_main+0x10d>
call   10b0 <pretty_print_signals@plt>
xor    %edi,%edi
call   10c0 <exit@plt>
add    $0x1,%rbp
mov    $0xfffffffe,%r13d
mov    $0x2,%ecx
mov    %rbp,%r12
jmp    1317 <kill_main+0x167>
cmp    $0x80,%r15d
jg     1297 <kill_main+0xe7>
mov    0x10(%r14),%rax
cmpb   $0x2d,(%rax)
jne    129e <kill_main+0xee>
xor    %eax,%eax
call   1050 <kill_usage@plt>
add    $0xfffffffe,%r15d
add    $0x10,%r14
mov    %r15d,%edi
mov    %r14,%rsi
mov    $0x50,%edx
call   10a0 <print_given_signals@plt>
mov    %eax,%edi
call   10c0 <exit@plt>
call   1050 <kill_usage@plt>
mov    (%rbx),%rbp
mov    0x1(%rbp),%al
cmp    $0x2d,%al
jne    12ef <kill_main+0x13f>
cmpb   $0x0,0x2(%rbp)
jne    12e2 <kill_main+0x132>
add    $0x10,%r14
add    $0xfffffffe,%r15d
mov    %r14,%rbx
mov    %r15d,%r13d
jmp    134d <kill_main+0x19d>
xor    %eax,%eax
call   1050 <kill_usage@plt>
mov    (%rbx),%rbp
mov    0x1(%rbp),%al
lea    0x1(%rbp),%r12
mov    $0xfffffffe,%r13d
mov    $0x2,%ecx
cmp    $0x73,%al
jne    1317 <kill_main+0x167>
cmpb   $0x0,0x2(%rbp)
jne    1317 <kill_main+0x167>
mov    0x10(%r14),%r12
mov    $0xfffffffd,%r13d
mov    $0x3,%ecx
lea    (%r14,%rcx,8),%rbx
add    %r15d,%r13d
mov    %r12,%rdi
call   1040 <signal_name_to_number@plt>
mov    %eax,0xc(%rsp)
test   %eax,%eax
jns    134d <kill_main+0x19d>
mov    0x2ca3(%rip),%rax
mov    (%rax),%edi
lea    0xccf(%rip),%rsi
mov    %r12,%rdx
call   1070 <fprintf@plt>
xor    %eax,%eax
call   1050 <kill_usage@plt>
test   %r13d,%r13d
jne    1362 <kill_main+0x1b2>
xor    %ebp,%ebp
xor    %eax,%eax
call   1050 <kill_usage@plt>
mov    %ebp,%edi
call   10c0 <exit@plt>
movslq %r13d,%rax
lea    (%rbx,%rax,8),%rbx
add    $0xfffffffffffffff8,%rbx
neg    %r13d
lea    0x10(%rsp),%r15
lea    0xcb3(%rip),%r14
xor    %r12d,%r12d
xor    %ebp,%ebp
jmp    13b5 <kill_main+0x205>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    0x2c41(%rip),%rax
mov    (%rax),%edi
mov    (%rbx,%r12,8),%rdx
mov    %r14,%rsi
call   1070 <fprintf@plt>
xor    %eax,%eax
call   1050 <kill_usage@plt>
add    $0xffffffffffffffff,%r12
cmp    %r12d,%r13d
je     13e7 <kill_main+0x237>
mov    (%rbx,%r12,8),%rdi
mov    %r15,%rsi
mov    $0xa,%edx
call   1080 <strtol@plt>
mov    0x10(%rsp),%rcx
cmpb   $0x0,(%rcx)
jne    1390 <kill_main+0x1e0>
mov    %eax,%edi
mov    0xc(%rsp),%esi
call   1090 <kill@plt>
test   %eax,%eax
mov    $0x1,%eax
cmovne %eax,%ebp
jmp    13ac <kill_main+0x1fc>
mov    %ebp,%edi
call   10c0 <exit@plt>

LLVM IR (-O0):
@SIGTERM = global i32 0
@.str = [3 x i8] c"-V\00"
@.str.1 = [10 x i8] c"--version\00"
@stderr = global i32 0
@.str.2 = [34 x i8] c"ERROR: unknown signal name \22%s\22.\0A\00"
@.str.3 = [33 x i8] c"ERROR: garbage process ID \22%s\22.\0A\00"
define void @kill_main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i64
%9 = alloca i8*
store i32 %0, i32* %3
store i8** %1, i8*** %4
%10 = load i32, i32* @SIGTERM
store i32 %10, i32* %6
store i32 0, i32* %7
%11 = load i32, i32* %3
%12 = icmp slt i32 %11, 2
br i1 %12, label %13, label %15
13: ; preds = %2
%14 = call i32 (...) @kill_usage()
br label %15
15: ; preds = %13, %2
%16 = load i8**, i8*** %4
%17 = getelementptr inbounds i8*, i8** %16, i64 1
%18 = load i8*, i8** %17
%19 = call i32 @strcmp(i8* %18, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%20 = icmp ne i32 %19, 0
br i1 %20, label %21, label %27
21: ; preds = %15
%22 = load i8**, i8*** %4
%23 = getelementptr inbounds i8*, i8** %22, i64 1
%24 = load i8*, i8** %23
%25 = call i32 @strcmp(i8* %24, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%26 = icmp ne i32 %25, 0
br i1 %26, label %30, label %27
27: ; preds = %21, %15
%28 = call i32 (...) @display_kill_version()
%29 = call i32 @exit(i32 0)
unreachable
30: ; preds = %21
%31 = load i8**, i8*** %4
%32 = getelementptr inbounds i8*, i8** %31, i64 1
%33 = load i8*, i8** %32
%34 = getelementptr inbounds i8, i8* %33, i64 0
%35 = load i8, i8* %34
%36 = sext i8 %35 to i32
%37 = icmp ne i32 %36, 45
br i1 %37, label %38, label %43
38: ; preds = %30
%39 = load i8**, i8*** %4
%40 = getelementptr inbounds i8*, i8** %39, i32 1
store i8** %40, i8*** %4
%41 = load i32, i32* %3
%42 = add nsw i32 %41, -1
store i32 %42, i32* %3
br label %184
43: ; preds = %30
%44 = load i8**, i8*** %4
%45 = getelementptr inbounds i8*, i8** %44, i64 1
%46 = load i8*, i8** %45
%47 = getelementptr inbounds i8, i8* %46, i64 1
%48 = load i8, i8* %47
%49 = sext i8 %48 to i32
%50 = icmp eq i32 %49, 108
br i1 %50, label %51, label %85
51: ; preds = %43
%52 = load i8**, i8*** %4
%53 = getelementptr inbounds i8*, i8** %52, i64 1
%54 = load i8*, i8** %53
%55 = getelementptr inbounds i8, i8* %54, i64 2
%56 = load i8, i8* %55
%57 = sext i8 %56 to i32
%58 = icmp eq i32 %57, 0
br i1 %58, label %59, label %85
59: ; preds = %51
%60 = load i32, i32* %3
%61 = icmp eq i32 %60, 2
br i1 %61, label %62, label %65
62: ; preds = %59
%63 = call i32 (...) @unix_print_signals()
%64 = call i32 @exit(i32 0)
unreachable
65: ; preds = %59
%66 = load i32, i32* %3
%67 = icmp sgt i32 %66, 128
br i1 %67, label %76, label %68
68: ; preds = %65
%69 = load i8**, i8*** %4
%70 = getelementptr inbounds i8*, i8** %69, i64 2
%71 = load i8*, i8** %70
%72 = getelementptr inbounds i8, i8* %71, i64 0
%73 = load i8, i8* %72
%74 = sext i8 %73 to i32
%75 = icmp eq i32 %74, 45
br i1 %75, label %76, label %78
76: ; preds = %68, %65
%77 = call i32 (...) @kill_usage()
br label %78
78: ; preds = %76, %68
%79 = load i32, i32* %3
%80 = sub nsw i32 %79, 2
%81 = load i8**, i8*** %4
%82 = getelementptr inbounds i8*, i8** %81, i64 2
%83 = call i32 @print_given_signals(i32 %80, i8** %82, i32 80)
%84 = call i32 @exit(i32 %83)
unreachable
85: ; preds = %51, %43
%86 = load i8**, i8*** %4
%87 = getelementptr inbounds i8*, i8** %86, i64 1
%88 = load i8*, i8** %87
%89 = getelementptr inbounds i8, i8* %88, i64 1
%90 = load i8, i8* %89
%91 = sext i8 %90 to i32
%92 = icmp eq i32 %91, 76
br i1 %92, label %93, label %109
93: ; preds = %85
%94 = load i8**, i8*** %4
%95 = getelementptr inbounds i8*, i8** %94, i64 1
%96 = load i8*, i8** %95
%97 = getelementptr inbounds i8, i8* %96, i64 2
%98 = load i8, i8* %97
%99 = sext i8 %98 to i32
%100 = icmp eq i32 %99, 0
br i1 %100, label %101, label %109
101: ; preds = %93
%102 = load i32, i32* %3
%103 = icmp eq i32 %102, 2
br i1 %103, label %104, label %107
104: ; preds = %101
%105 = call i32 (...) @pretty_print_signals()
%106 = call i32 @exit(i32 0)
unreachable
107: ; preds = %101
%108 = call i32 (...) @kill_usage()
br label %109
109: ; preds = %107, %93, %85
%110 = load i8**, i8*** %4
%111 = getelementptr inbounds i8*, i8** %110, i64 1
%112 = load i8*, i8** %111
%113 = getelementptr inbounds i8, i8* %112, i64 1
%114 = load i8, i8* %113
%115 = sext i8 %114 to i32
%116 = icmp eq i32 %115, 45
br i1 %116, label %117, label %130
117: ; preds = %109
%118 = load i8**, i8*** %4
%119 = getelementptr inbounds i8*, i8** %118, i64 1
%120 = load i8*, i8** %119
%121 = getelementptr inbounds i8, i8* %120, i64 2
%122 = load i8, i8* %121
%123 = sext i8 %122 to i32
%124 = icmp eq i32 %123, 0
br i1 %124, label %125, label %130
125: ; preds = %117
%126 = load i8**, i8*** %4
%127 = getelementptr inbounds i8*, i8** %126, i64 2
store i8** %127, i8*** %4
%128 = load i32, i32* %3
%129 = sub nsw i32 %128, 2
store i32 %129, i32* %3
br label %184
130: ; preds = %117, %109
%131 = load i8**, i8*** %4
%132 = getelementptr inbounds i8*, i8** %131, i64 1
%133 = load i8*, i8** %132
%134 = getelementptr inbounds i8, i8* %133, i64 1
%135 = load i8, i8* %134
%136 = sext i8 %135 to i32
%137 = icmp eq i32 %136, 45
br i1 %137, label %138, label %140
138: ; preds = %130
%139 = call i32 (...) @kill_usage()
br label %140
140: ; preds = %138, %130
%141 = load i8**, i8*** %4
%142 = getelementptr inbounds i8*, i8** %141, i64 1
%143 = load i8*, i8** %142
%144 = getelementptr inbounds i8, i8* %143, i64 1
%145 = load i8, i8* %144
%146 = sext i8 %145 to i32
%147 = icmp eq i32 %146, 115
br i1 %147, label %148, label %164
148: ; preds = %140
%149 = load i8**, i8*** %4
%150 = getelementptr inbounds i8*, i8** %149, i64 1
%151 = load i8*, i8** %150
%152 = getelementptr inbounds i8, i8* %151, i64 2
%153 = load i8, i8* %152
%154 = sext i8 %153 to i32
%155 = icmp eq i32 %154, 0
br i1 %155, label %156, label %164
156: ; preds = %148
%157 = load i8**, i8*** %4
%158 = getelementptr inbounds i8*, i8** %157, i64 2
%159 = load i8*, i8** %158
store i8* %159, i8** %5
%160 = load i8**, i8*** %4
%161 = getelementptr inbounds i8*, i8** %160, i64 3
store i8** %161, i8*** %4
%162 = load i32, i32* %3
%163 = sub nsw i32 %162, 3
store i32 %163, i32* %3
br label %173
164: ; preds = %148, %140
%165 = load i8**, i8*** %4
%166 = getelementptr inbounds i8*, i8** %165, i64 1
%167 = load i8*, i8** %166
%168 = getelementptr inbounds i8, i8* %167, i64 1
store i8* %168, i8** %5
%169 = load i8**, i8*** %4
%170 = getelementptr inbounds i8*, i8** %169, i64 2
store i8** %170, i8*** %4
%171 = load i32, i32* %3
%172 = sub nsw i32 %171, 2
store i32 %172, i32* %3
br label %173
173: ; preds = %164, %156
%174 = load i8*, i8** %5
%175 = call i32 @signal_name_to_number(i8* %174)
store i32 %175, i32* %6
%176 = load i32, i32* %6
%177 = icmp slt i32 %176, 0
br i1 %177, label %178, label %183
178: ; preds = %173
%179 = load i32, i32* @stderr
%180 = load i8*, i8** %5
%181 = call i32 @fprintf(i32 %179, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0), i8* %180)
%182 = call i32 (...) @kill_usage()
br label %183
183: ; preds = %178, %173
br label %184
184: ; preds = %183, %125, %38
%185 = load i32, i32* %3
%186 = icmp ne i32 %185, 0
br i1 %186, label %189, label %187
187: ; preds = %184
%188 = call i32 (...) @kill_usage()
br label %189
189: ; preds = %187, %184
br label %190
190: ; preds = %212, %211, %210, %189
%191 = load i32, i32* %3
%192 = add nsw i32 %191, -1
store i32 %192, i32* %3
%193 = icmp ne i32 %191, 0
br i1 %193, label %194, label %221
194: ; preds = %190
%195 = load i8**, i8*** %4
%196 = load i32, i32* %3
%197 = sext i32 %196 to i64
%198 = getelementptr inbounds i8*, i8** %195, i64 %197
%199 = load i8*, i8** %198
%200 = call i64 @strtol(i8* %199, i8** %9, i32 10)
store i64 %200, i64* %8
%201 = load i8*, i8** %9
%202 = load i8, i8* %201
%203 = icmp ne i8 %202, 0
br i1 %203, label %212, label %204
204: ; preds = %194
%205 = load i64, i64* %8
%206 = trunc i64 %205 to i32
%207 = load i32, i32* %6
%208 = call i32 @kill(i32 %206, i32 %207)
%209 = icmp ne i32 %208, 0
br i1 %209, label %211, label %210
210: ; preds = %204
br label %190
211: ; preds = %204
store i32 1, i32* %7
br label %190
212: ; preds = %194
%213 = load i32, i32* @stderr
%214 = load i8**, i8*** %4
%215 = load i32, i32* %3
%216 = sext i32 %215 to i64
%217 = getelementptr inbounds i8*, i8** %214, i64 %216
%218 = load i8*, i8** %217
%219 = call i32 @fprintf(i32 %213, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0), i8* %218)
%220 = call i32 (...) @kill_usage()
br label %190
221: ; preds = %190
%222 = load i32, i32* %7
%223 = call i32 @exit(i32 %222)
unreachable
}

LLVM IR (-O2):
@SIGTERM = global i32 0
@.str = [3 x i8] c"-V\00"
@.str.1 = [10 x i8] c"--version\00"
@stderr = global i32 0
@.str.2 = [34 x i8] c"ERROR: unknown signal name \22%s\22.\0A\00"
@.str.3 = [33 x i8] c"ERROR: garbage process ID \22%s\22.\0A\00"
define void @kill_main(i32 %0, i8** %1) {
%3 = alloca i8*
%4 = load i32, i32* @SIGTERM
%5 = icmp slt i32 %0, 2
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 (...) @kill_usage()
br label %8
8: ; preds = %6, %2
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = tail call i32 @strcmp(i8* dereferenceable(1) %10, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%12 = icmp eq i32 %11, 0
br i1 %12, label %16, label %13
13: ; preds = %8
%14 = tail call i32 @strcmp(i8* dereferenceable(1) %10, i8* dereferenceable(10) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %19
16: ; preds = %13, %8
%17 = tail call i32 (...) @display_kill_version()
%18 = tail call i32 @exit(i32 0)
unreachable
19: ; preds = %13
%20 = load i8, i8* %10
%21 = icmp eq i8 %20, 45
br i1 %21, label %24, label %22
22: ; preds = %19
%23 = add nsw i32 %0, -1
br label %106
24: ; preds = %19
%25 = getelementptr inbounds i8, i8* %10, i64 1
%26 = load i8, i8* %25
switch i8 %26, label %66 [
i8 108, label %27
i8 76, label %50
]
27: ; preds = %24
%28 = getelementptr inbounds i8, i8* %10, i64 2
%29 = load i8, i8* %28
%30 = icmp eq i8 %29, 0
br i1 %30, label %31, label %64
31: ; preds = %27
%32 = icmp eq i32 %0, 2
br i1 %32, label %33, label %36
33: ; preds = %31
%34 = tail call i32 (...) @unix_print_signals()
%35 = tail call i32 @exit(i32 0)
unreachable
36: ; preds = %31
%37 = icmp sgt i32 %0, 128
br i1 %37, label %43, label %38
38: ; preds = %36
%39 = getelementptr inbounds i8*, i8** %1, i64 2
%40 = load i8*, i8** %39
%41 = load i8, i8* %40
%42 = icmp eq i8 %41, 45
br i1 %42, label %43, label %45
43: ; preds = %38, %36
%44 = tail call i32 (...) @kill_usage()
br label %45
45: ; preds = %43, %38
%46 = add nsw i32 %0, -2
%47 = getelementptr inbounds i8*, i8** %1, i64 2
%48 = tail call i32 @print_given_signals(i32 %46, i8** %47, i32 80)
%49 = tail call i32 @exit(i32 %48)
unreachable
50: ; preds = %24
%51 = getelementptr inbounds i8, i8* %10, i64 2
%52 = load i8, i8* %51
%53 = icmp eq i8 %52, 0
br i1 %53, label %54, label %64
54: ; preds = %50
%55 = icmp eq i32 %0, 2
br i1 %55, label %56, label %59
56: ; preds = %54
%57 = tail call i32 (...) @pretty_print_signals()
%58 = tail call i32 @exit(i32 0)
unreachable
59: ; preds = %54
%60 = tail call i32 (...) @kill_usage()
%61 = load i8*, i8** %9
%62 = getelementptr inbounds i8, i8* %61, i64 1
%63 = load i8, i8* %62
br label %66
64: ; preds = %50, %27
%65 = getelementptr inbounds i8, i8* %10, i64 1
br label %94
66: ; preds = %24, %59
%67 = phi i8 [ %26, %24 ], [ %63, %59 ]
%68 = phi i8* [ %10, %24 ], [ %61, %59 ]
%69 = icmp eq i8 %67, 45
br i1 %69, label %70, label %82
70: ; preds = %66
%71 = getelementptr inbounds i8, i8* %68, i64 2
%72 = load i8, i8* %71
%73 = icmp eq i8 %72, 0
br i1 %73, label %74, label %77
74: ; preds = %70
%75 = getelementptr inbounds i8*, i8** %1, i64 2
%76 = add nsw i32 %0, -2
br label %106
77: ; preds = %70
%78 = tail call i32 (...) @kill_usage()
%79 = load i8*, i8** %9
%80 = getelementptr inbounds i8, i8* %79, i64 1
%81 = load i8, i8* %80
br label %82
82: ; preds = %66, %77
%83 = phi i8 [ %67, %66 ], [ %81, %77 ]
%84 = phi i8* [ %68, %66 ], [ %79, %77 ]
%85 = getelementptr inbounds i8, i8* %84, i64 1
%86 = icmp eq i8 %83, 115
br i1 %86, label %87, label %94
87: ; preds = %82
%88 = getelementptr inbounds i8, i8* %84, i64 2
%89 = load i8, i8* %88
%90 = icmp eq i8 %89, 0
br i1 %90, label %91, label %94
91: ; preds = %87
%92 = getelementptr inbounds i8*, i8** %1, i64 2
%93 = load i8*, i8** %92
br label %94
94: ; preds = %82, %87, %64, %91
%95 = phi i64 [ 3, %91 ], [ 2, %64 ], [ 2, %87 ], [ 2, %82 ]
%96 = phi i32 [ -3, %91 ], [ -2, %64 ], [ -2, %87 ], [ -2, %82 ]
%97 = phi i8* [ %93, %91 ], [ %65, %64 ], [ %85, %87 ], [ %85, %82 ]
%98 = getelementptr inbounds i8*, i8** %1, i64 %95
%99 = add nsw i32 %96, %0
%100 = tail call i32 @signal_name_to_number(i8* %97)
%101 = icmp slt i32 %100, 0
br i1 %101, label %102, label %106
102: ; preds = %94
%103 = load i32, i32* @stderr
%104 = tail call i32 @fprintf(i32 %103, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0), i8* %97)
%105 = tail call i32 (...) @kill_usage()
br label %106
106: ; preds = %94, %102, %74, %22
%107 = phi i8** [ %9, %22 ], [ %75, %74 ], [ %98, %102 ], [ %98, %94 ]
%108 = phi i32 [ %4, %22 ], [ %4, %74 ], [ %100, %102 ], [ %100, %94 ]
%109 = phi i32 [ %23, %22 ], [ %76, %74 ], [ %99, %102 ], [ %99, %94 ]
%110 = icmp eq i32 %109, 0
br i1 %110, label %111, label %113
111: ; preds = %106
%112 = tail call i32 (...) @kill_usage()
br label %140
113: ; preds = %106
%114 = bitcast i8** %3 to i8*
%115 = sext i32 %109 to i64
br label %116
116: ; preds = %113, %136
%117 = phi i64 [ %115, %113 ], [ %119, %136 ]
%118 = phi i32 [ 0, %113 ], [ %137, %136 ]
%119 = add nsw i64 %117, -1
%120 = getelementptr inbounds i8*, i8** %107, i64 %119
%121 = load i8*, i8** %120
%122 = call i64 @strtol(i8* %121, i8** %3, i32 10)
%123 = load i8*, i8** %3
%124 = load i8, i8* %123
%125 = icmp eq i8 %124, 0
br i1 %125, label %126, label %131
126: ; preds = %116
%127 = trunc i64 %122 to i32
%128 = tail call i32 @kill(i32 %127, i32 %108)
%129 = icmp eq i32 %128, 0
%130 = select i1 %129, i32 %118, i32 1
br label %136
131: ; preds = %116
%132 = load i32, i32* @stderr
%133 = load i8*, i8** %120
%134 = tail call i32 @fprintf(i32 %132, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0), i8* %133)
%135 = tail call i32 (...) @kill_usage()
br label %136
136: ; preds = %126, %131
%137 = phi i32 [ %118, %131 ], [ %130, %126 ]
%138 = trunc i64 %119 to i32
%139 = icmp eq i32 %138, 0
br i1 %139, label %140, label %116
140: ; preds = %136, %111
%141 = phi i32 [ 0, %111 ], [ %137, %136 ]
%142 = tail call i32 @exit(i32 %141)
unreachable
}