#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 EmptyOrError(int, char **);
int Os9Send(int, int);
int atoi(char *);
int picolCommand9Kill(int argc, char **argv, void *pd) {
  int victim = atoi(argv[1]);
  int signal = (argc < 3) ? 228 : atoi(argv[2]);
  int e = Os9Send(victim, signal);
  return EmptyOrError(e, argv);
}


x86 assembly (clang, -O0):
<picolCommand9Kill>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x3,-0x4(%rbp)
jge    116a <picolCommand9Kill+0x3a>
mov    $0xe4,%eax
mov    %eax,-0x28(%rbp)
jmp    117a <picolCommand9Kill+0x4a>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%edi
mov    -0x20(%rbp),%esi
call   1040 <Os9Send@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <EmptyOrError@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<picolCommand9Kill>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x8(%rsi),%rdi
call   1050 <atoi@plt>
mov    %eax,%r14d
mov    $0xe4,%esi
cmp    $0x3,%ebp
jl     115a <picolCommand9Kill+0x2a>
mov    0x10(%rbx),%rdi
call   1050 <atoi@plt>
mov    %eax,%esi
mov    %r14d,%edi
call   1040 <Os9Send@plt>
mov    %eax,%edi
mov    %rbx,%rsi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <EmptyOrError@plt>

LLVM IR (-O0):
define i32 @picolCommand9Kill(i32 %0, i8** %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* %2, i8** %6
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = call i32 @atoi(i8* %12)
store i32 %13, i32* %7
%14 = load i32, i32* %4
%15 = icmp slt i32 %14, 3
br i1 %15, label %16, label %17
16: ; preds = %3
br label %22
17: ; preds = %3
%18 = load i8**, i8*** %5
%19 = getelementptr inbounds i8*, i8** %18, i64 2
%20 = load i8*, i8** %19
%21 = call i32 @atoi(i8* %20)
br label %22
22: ; preds = %17, %16
%23 = phi i32 [ 228, %16 ], [ %21, %17 ]
store i32 %23, i32* %8
%24 = load i32, i32* %7
%25 = load i32, i32* %8
%26 = call i32 @Os9Send(i32 %24, i32 %25)
store i32 %26, i32* %9
%27 = load i32, i32* %9
%28 = load i8**, i8*** %5
%29 = call i32 @EmptyOrError(i32 %27, i8** %28)
ret i32 %29
}

LLVM IR (-O2):
define i32 @picolCommand9Kill(i32 %0, i8** %1, i8* nocapture readnone %2) {
%4 = getelementptr inbounds i8*, i8** %1, i64 1
%5 = load i8*, i8** %4
%6 = tail call i32 @atoi(i8* %5)
%7 = icmp slt i32 %0, 3
br i1 %7, label %12, label %8
8: ; preds = %3
%9 = getelementptr inbounds i8*, i8** %1, i64 2
%10 = load i8*, i8** %9
%11 = tail call i32 @atoi(i8* %10)
br label %12
12: ; preds = %3, %8
%13 = phi i32 [ %11, %8 ], [ 228, %3 ]
%14 = tail call i32 @Os9Send(i32 %6, i32 %13)
%15 = tail call i32 @EmptyOrError(i32 %14, i8** %1)
ret i32 %15
}