#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 /*<<< orphan*/ snprintf(char *, size_t, char *, char const *, ...);
scalar_t__ strcmp(char const *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
void translate_command(char *buf, size_t bufsize, int argc, char **argv) {
  const char *cmd = argv[0];
  if (strcmp(cmd, "load") == 0 && argc >= 2) {
    if (argc > 2 && strcmp(argv[2], "true") == 0) {
      snprintf(buf, bufsize, "ATTACH_LOADAGENTPATH(%s,%s)", argv[1],
               argc > 3 ? argv[3] : "");
    } else {
      snprintf(buf, bufsize, "ATTACH_LOADAGENT(%s,%s)", argv[1],
               argc > 3 ? argv[3] : "");
    }
  } else if (strcmp(cmd, "jcmd") == 0) {
    snprintf(buf, bufsize, "ATTACH_DIAGNOSTICS:%s,%s",
             argc > 1 ? argv[1] : "help", argc > 2 ? argv[2] : "");
  } else if (strcmp(cmd, "threaddump") == 0) {
    snprintf(buf, bufsize, "ATTACH_DIAGNOSTICS:Thread.print,%s",
             argc > 1 ? argv[1] : "");
  } else if (strcmp(cmd, "dumpheap") == 0) {
    snprintf(buf, bufsize, "ATTACH_DIAGNOSTICS:Dump.heap,%s",
             argc > 1 ? argv[1] : "");
  } else if (strcmp(cmd, "inspectheap") == 0) {
    snprintf(buf, bufsize, "ATTACH_DIAGNOSTICS:GC.class_histogram,%s",
             argc > 1 ? argv[1] : "");
  } else if (strcmp(cmd, "datadump") == 0) {
    snprintf(buf, bufsize, "ATTACH_DIAGNOSTICS:Dump.java,%s",
             argc > 1 ? argv[1] : "");
  } else if (strcmp(cmd, "properties") == 0) {
    strcpy(buf, "ATTACH_GETSYSTEMPROPERTIES");
  } else if (strcmp(cmd, "agentProperties") == 0) {
    strcpy(buf, "ATTACH_GETAGENTPROPERTIES");
  } else {
    snprintf(buf, bufsize, "%s", cmd);
  }
  buf[bufsize - 1] = 0;
}


x86 assembly (clang, -O0):
<translate_command>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
lea    0xea0(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    1275 <translate_command+0x145>
cmpl   $0x2,-0x14(%rbp)
jl     1275 <translate_command+0x145>
cmpl   $0x2,-0x14(%rbp)
jle    120b <translate_command+0xdb>
mov    -0x20(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xe73(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    120b <translate_command+0xdb>
mov    -0x8(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x20(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x30(%rbp)
cmpl   $0x3,-0x14(%rbp)
jle    11d8 <translate_command+0xa8>
mov    -0x20(%rbp),%rax
mov    0x18(%rax),%rax
mov    %rax,-0x48(%rbp)
jmp    11e8 <translate_command+0xb8>
lea    0xe46(%rip),%rax
mov    %rax,-0x48(%rbp)
jmp    11e8 <translate_command+0xb8>
mov    -0x30(%rbp),%rcx
mov    -0x38(%rbp),%rsi
mov    -0x40(%rbp),%rdi
mov    -0x48(%rbp),%r8
lea    0xe0b(%rip),%rdx
mov    $0x0,%al
call   1040 <snprintf@plt>
jmp    1270 <translate_command+0x140>
mov    -0x8(%rbp),%rax
mov    %rax,-0x60(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    -0x20(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x50(%rbp)
cmpl   $0x3,-0x14(%rbp)
jle    1242 <translate_command+0x112>
mov    -0x20(%rbp),%rax
mov    0x18(%rax),%rax
mov    %rax,-0x68(%rbp)
jmp    1252 <translate_command+0x122>
lea    0xddc(%rip),%rax
mov    %rax,-0x68(%rbp)
jmp    1252 <translate_command+0x122>
mov    -0x50(%rbp),%rcx
mov    -0x58(%rbp),%rsi
mov    -0x60(%rbp),%rdi
mov    -0x68(%rbp),%r8
lea    0xdbd(%rip),%rdx
mov    $0x0,%al
call   1040 <snprintf@plt>
jmp    15ee <translate_command+0x4be>
mov    -0x28(%rbp),%rdi
lea    0xdbe(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    132f <translate_command+0x1ff>
mov    -0x8(%rbp),%rax
mov    %rax,-0x78(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x70(%rbp)
cmpl   $0x1,-0x14(%rbp)
jle    12ba <translate_command+0x18a>
mov    -0x20(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x80(%rbp)
jmp    12ca <translate_command+0x19a>
lea    0xd9b(%rip),%rax
mov    %rax,-0x80(%rbp)
jmp    12ca <translate_command+0x19a>
mov    -0x80(%rbp),%rax
mov    %rax,-0x88(%rbp)
cmpl   $0x2,-0x14(%rbp)
jle    12f3 <translate_command+0x1c3>
mov    -0x20(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x90(%rbp)
jmp    1306 <translate_command+0x1d6>
lea    0xd2b(%rip),%rax
mov    %rax,-0x90(%rbp)
jmp    1306 <translate_command+0x1d6>
mov    -0x88(%rbp),%rcx
mov    -0x70(%rbp),%rsi
mov    -0x78(%rbp),%rdi
mov    -0x90(%rbp),%r8
lea    0xd20(%rip),%rdx
mov    $0x0,%al
call   1040 <snprintf@plt>
jmp    15e9 <translate_command+0x4b9>
mov    -0x28(%rbp),%rdi
lea    0xd27(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    13b8 <translate_command+0x288>
mov    -0x8(%rbp),%rax
mov    %rax,-0xa0(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x98(%rbp)
cmpl   $0x1,-0x14(%rbp)
jle    137d <translate_command+0x24d>
mov    -0x20(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0xa8(%rbp)
jmp    1390 <translate_command+0x260>
lea    0xca1(%rip),%rax
mov    %rax,-0xa8(%rbp)
jmp    1390 <translate_command+0x260>
mov    -0x98(%rbp),%rsi
mov    -0xa0(%rbp),%rdi
mov    -0xa8(%rbp),%rcx
lea    0xcc0(%rip),%rdx
mov    $0x0,%al
call   1040 <snprintf@plt>
jmp    15e4 <translate_command+0x4b4>
mov    -0x28(%rbp),%rdi
lea    0xccc(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    1441 <translate_command+0x311>
mov    -0x8(%rbp),%rax
mov    %rax,-0xb8(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0xb0(%rbp)
cmpl   $0x1,-0x14(%rbp)
jle    1406 <translate_command+0x2d6>
mov    -0x20(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0xc0(%rbp)
jmp    1419 <translate_command+0x2e9>
lea    0xc18(%rip),%rax
mov    %rax,-0xc0(%rbp)
jmp    1419 <translate_command+0x2e9>
mov    -0xb0(%rbp),%rsi
mov    -0xb8(%rbp),%rdi
mov    -0xc0(%rbp),%rcx
lea    0xc63(%rip),%rdx
mov    $0x0,%al
call   1040 <snprintf@plt>
jmp    15df <translate_command+0x4af>
mov    -0x28(%rbp),%rdi
lea    0xc6c(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    14ca <translate_command+0x39a>
mov    -0x8(%rbp),%rax
mov    %rax,-0xd0(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0xc8(%rbp)
cmpl   $0x1,-0x14(%rbp)
jle    148f <translate_command+0x35f>
mov    -0x20(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0xd8(%rbp)
jmp    14a2 <translate_command+0x372>
lea    0xb8f(%rip),%rax
mov    %rax,-0xd8(%rbp)
jmp    14a2 <translate_command+0x372>
mov    -0xc8(%rbp),%rsi
mov    -0xd0(%rbp),%rdi
mov    -0xd8(%rbp),%rcx
lea    0xc06(%rip),%rdx
mov    $0x0,%al
call   1040 <snprintf@plt>
jmp    15da <translate_command+0x4aa>
mov    -0x28(%rbp),%rdi
lea    0xc18(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    1553 <translate_command+0x423>
mov    -0x8(%rbp),%rax
mov    %rax,-0xe8(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0xe0(%rbp)
cmpl   $0x1,-0x14(%rbp)
jle    1518 <translate_command+0x3e8>
mov    -0x20(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0xf0(%rbp)
jmp    152b <translate_command+0x3fb>
lea    0xb06(%rip),%rax
mov    %rax,-0xf0(%rbp)
jmp    152b <translate_command+0x3fb>
mov    -0xe0(%rbp),%rsi
mov    -0xe8(%rbp),%rdi
mov    -0xf0(%rbp),%rcx
lea    0xbaf(%rip),%rdx
mov    $0x0,%al
call   1040 <snprintf@plt>
jmp    15d5 <translate_command+0x4a5>
mov    -0x28(%rbp),%rdi
lea    0xbb8(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    1582 <translate_command+0x452>
mov    -0x8(%rbp),%rdi
lea    0xba9(%rip),%rsi
call   1030 <strcpy@plt>
jmp    15d0 <translate_command+0x4a0>
mov    -0x28(%rbp),%rdi
lea    0xbaf(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    15b1 <translate_command+0x481>
mov    -0x8(%rbp),%rdi
lea    0xba5(%rip),%rsi
call   1030 <strcpy@plt>
jmp    15cb <translate_command+0x49b>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x28(%rbp),%rcx
lea    0xb4f(%rip),%rdx
mov    $0x0,%al
call   1040 <snprintf@plt>
jmp    15d0 <translate_command+0x4a0>
jmp    15d5 <translate_command+0x4a5>
jmp    15da <translate_command+0x4aa>
jmp    15df <translate_command+0x4af>
jmp    15e4 <translate_command+0x4b4>
jmp    15e9 <translate_command+0x4b9>
jmp    15ee <translate_command+0x4be>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0xf0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<translate_command>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rcx,%r12
mov    %edx,%ebp
mov    %rsi,%r14
mov    %rdi,%r15
mov    (%rcx),%rbx
lea    0xeb3(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
cmp    $0x2,%ebp
jl     11a1 <translate_command+0x71>
test   %rax,%rax
jne    11a1 <translate_command+0x71>
cmp    $0x2,%ebp
jbe    125e <translate_command+0x12e>
mov    0x10(%r12),%rdi
lea    0xe91(%rip),%rsi
call   1050 <strcmp@plt>
mov    0x8(%r12),%rcx
test   %rax,%rax
je     12a0 <translate_command+0x170>
cmp    $0x3,%ebp
je     1263 <translate_command+0x133>
mov    0x18(%r12),%r8
lea    0xe8a(%rip),%rdx
jmp    12f0 <translate_command+0x1c0>
lea    0xe96(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
test   %rax,%rax
je     1273 <translate_command+0x143>
lea    0xea1(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
test   %rax,%rax
je     1294 <translate_command+0x164>
lea    0xeb7(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
test   %rax,%rax
je     12be <translate_command+0x18e>
lea    0xec8(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
test   %rax,%rax
je     12ff <translate_command+0x1cf>
lea    0xee5(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
test   %rax,%rax
je     1322 <translate_command+0x1f2>
lea    0xef6(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
test   %rax,%rax
je     133e <translate_command+0x20e>
lea    0xf04(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
test   %rax,%rax
je     1371 <translate_command+0x241>
lea    0xec3(%rip),%rdx
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rcx
jmp    135b <translate_command+0x22b>
mov    0x8(%r12),%rcx
lea    0xdbb(%rip),%r8
lea    0xdb5(%rip),%rdx
jmp    12f0 <translate_command+0x1c0>
lea    0xdab(%rip),%r8
cmp    $0x2,%ebp
jl     12ae <translate_command+0x17e>
mov    0x8(%r12),%rcx
je     128b <translate_command+0x15b>
mov    0x10(%r12),%r8
lea    0xdb1(%rip),%rdx
jmp    12f0 <translate_command+0x1c0>
cmp    $0x2,%ebp
jl     12d4 <translate_command+0x1a4>
mov    0x8(%r12),%rcx
jmp    12db <translate_command+0x1ab>
cmp    $0x3,%ebp
jne    12e4 <translate_command+0x1b4>
lea    0xd79(%rip),%r8
jmp    12e9 <translate_command+0x1b9>
lea    0xda7(%rip),%rcx
lea    0xd87(%rip),%rdx
jmp    12f0 <translate_command+0x1c0>
cmp    $0x2,%ebp
jl     1312 <translate_command+0x1e2>
mov    0x8(%r12),%rcx
lea    0xdc9(%rip),%rdx
jmp    1355 <translate_command+0x225>
lea    0xd4a(%rip),%rcx
lea    0xd8a(%rip),%rdx
jmp    1355 <translate_command+0x225>
mov    0x18(%r12),%r8
lea    0xd1a(%rip),%rdx
mov    %r15,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <snprintf@plt>
jmp    1362 <translate_command+0x232>
cmp    $0x2,%ebp
jl     132e <translate_command+0x1fe>
mov    0x8(%r12),%rcx
lea    0xdb4(%rip),%rdx
jmp    1355 <translate_command+0x225>
lea    0xd0c(%rip),%rcx
lea    0xd78(%rip),%rdx
jmp    1355 <translate_command+0x225>
cmp    $0x2,%ebp
jl     1347 <translate_command+0x217>
mov    0x8(%r12),%rcx
jmp    134e <translate_command+0x21e>
lea    0xcf0(%rip),%rcx
lea    0xd88(%rip),%rdx
jmp    1355 <translate_command+0x225>
lea    0xddc(%rip),%rsi
jmp    1378 <translate_command+0x248>
lea    0xcd7(%rip),%rcx
lea    0xda1(%rip),%rdx
mov    %r15,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <snprintf@plt>
movb   $0x0,-0x1(%r14,%r15,1)
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xdd4(%rip),%rsi
mov    %r15,%rdi
call   1030 <strcpy@plt>
jmp    1362 <translate_command+0x232>

LLVM IR (-O0):
@.str = [5 x i8] c"load\00"
@.str.1 = [5 x i8] c"true\00"
@.str.2 = [28 x i8] c"ATTACH_LOADAGENTPATH(%s,%s)\00"
@.str.3 = [1 x i8] zeroinitializer
@.str.4 = [24 x i8] c"ATTACH_LOADAGENT(%s,%s)\00"
@.str.5 = [5 x i8] c"jcmd\00"
@.str.6 = [25 x i8] c"ATTACH_DIAGNOSTICS:%s,%s\00"
@.str.7 = [5 x i8] c"help\00"
@.str.8 = [11 x i8] c"threaddump\00"
@.str.9 = [35 x i8] c"ATTACH_DIAGNOSTICS:Thread.print,%s\00"
@.str.10 = [9 x i8] c"dumpheap\00"
@.str.11 = [32 x i8] c"ATTACH_DIAGNOSTICS:Dump.heap,%s\00"
@.str.12 = [12 x i8] c"inspectheap\00"
@.str.13 = [41 x i8] c"ATTACH_DIAGNOSTICS:GC.class_histogram,%s\00"
@.str.14 = [9 x i8] c"datadump\00"
@.str.15 = [32 x i8] c"ATTACH_DIAGNOSTICS:Dump.java,%s\00"
@.str.16 = [11 x i8] c"properties\00"
@.str.17 = [27 x i8] c"ATTACH_GETSYSTEMPROPERTIES\00"
@.str.18 = [16 x i8] c"agentProperties\00"
@.str.19 = [26 x i8] c"ATTACH_GETAGENTPROPERTIES\00"
@.str.20 = [3 x i8] c"%s\00"
define void @translate_command(i8* %0, i64 %1, i32 %2, i8** %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i32
%8 = alloca i8**
%9 = alloca i8*
store i8* %0, i8** %5
store i64 %1, i64* %6
store i32 %2, i32* %7
store i8** %3, i8*** %8
%10 = load i8**, i8*** %8
%11 = getelementptr inbounds i8*, i8** %10, i64 0
%12 = load i8*, i8** %11
store i8* %12, i8** %9
%13 = load i8*, i8** %9
%14 = call i64 @strcmp(i8* %13, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%15 = icmp eq i64 %14, 0
br i1 %15, label %16, label %61
16: ; preds = %4
%17 = load i32, i32* %7
%18 = icmp sge i32 %17, 2
br i1 %18, label %19, label %61
19: ; preds = %16
%20 = load i32, i32* %7
%21 = icmp sgt i32 %20, 2
br i1 %21, label %22, label %44
22: ; preds = %19
%23 = load i8**, i8*** %8
%24 = getelementptr inbounds i8*, i8** %23, i64 2
%25 = load i8*, i8** %24
%26 = call i64 @strcmp(i8* %25, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%27 = icmp eq i64 %26, 0
br i1 %27, label %28, label %44
28: ; preds = %22
%29 = load i8*, i8** %5
%30 = load i64, i64* %6
%31 = load i8**, i8*** %8
%32 = getelementptr inbounds i8*, i8** %31, i64 1
%33 = load i8*, i8** %32
%34 = load i32, i32* %7
%35 = icmp sgt i32 %34, 3
br i1 %35, label %36, label %40
36: ; preds = %28
%37 = load i8**, i8*** %8
%38 = getelementptr inbounds i8*, i8** %37, i64 3
%39 = load i8*, i8** %38
br label %41
40: ; preds = %28
br label %41
41: ; preds = %40, %36
%42 = phi i8* [ %39, %36 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0), %40 ]
%43 = call i32 (i8*, i64, i8*, i8*, ...) @snprintf(i8* %29, i64 %30, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i8* %33, i8* %42)
br label %60
44: ; preds = %22, %19
%45 = load i8*, i8** %5
%46 = load i64, i64* %6
%47 = load i8**, i8*** %8
%48 = getelementptr inbounds i8*, i8** %47, i64 1
%49 = load i8*, i8** %48
%50 = load i32, i32* %7
%51 = icmp sgt i32 %50, 3
br i1 %51, label %52, label %56
52: ; preds = %44
%53 = load i8**, i8*** %8
%54 = getelementptr inbounds i8*, i8** %53, i64 3
%55 = load i8*, i8** %54
br label %57
56: ; preds = %44
br label %57
57: ; preds = %56, %52
%58 = phi i8* [ %55, %52 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0), %56 ]
%59 = call i32 (i8*, i64, i8*, i8*, ...) @snprintf(i8* %45, i64 %46, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0), i8* %49, i8* %58)
br label %60
60: ; preds = %57, %41
br label %181
61: ; preds = %16, %4
%62 = load i8*, i8** %9
%63 = call i64 @strcmp(i8* %62, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%64 = icmp eq i64 %63, 0
br i1 %64, label %65, label %87
65: ; preds = %61
%66 = load i8*, i8** %5
%67 = load i64, i64* %6
%68 = load i32, i32* %7
%69 = icmp sgt i32 %68, 1
br i1 %69, label %70, label %74
70: ; preds = %65
%71 = load i8**, i8*** %8
%72 = getelementptr inbounds i8*, i8** %71, i64 1
%73 = load i8*, i8** %72
br label %75
74: ; preds = %65
br label %75
75: ; preds = %74, %70
%76 = phi i8* [ %73, %70 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), %74 ]
%77 = load i32, i32* %7
%78 = icmp sgt i32 %77, 2
br i1 %78, label %79, label %83
79: ; preds = %75
%80 = load i8**, i8*** %8
%81 = getelementptr inbounds i8*, i8** %80, i64 2
%82 = load i8*, i8** %81
br label %84
83: ; preds = %75
br label %84
84: ; preds = %83, %79
%85 = phi i8* [ %82, %79 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0), %83 ]
%86 = call i32 (i8*, i64, i8*, i8*, ...) @snprintf(i8* %66, i64 %67, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.6, i64 0, i64 0), i8* %76, i8* %85)
br label %180
87: ; preds = %61
%88 = load i8*, i8** %9
%89 = call i64 @strcmp(i8* %88, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0))
%90 = icmp eq i64 %89, 0
br i1 %90, label %91, label %104
91: ; preds = %87
%92 = load i8*, i8** %5
%93 = load i64, i64* %6
%94 = load i32, i32* %7
%95 = icmp sgt i32 %94, 1
br i1 %95, label %96, label %100
96: ; preds = %91
%97 = load i8**, i8*** %8
%98 = getelementptr inbounds i8*, i8** %97, i64 1
%99 = load i8*, i8** %98
br label %101
100: ; preds = %91
br label %101
101: ; preds = %100, %96
%102 = phi i8* [ %99, %96 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0), %100 ]
%103 = call i32 (i8*, i64, i8*, i8*, ...) @snprintf(i8* %92, i64 %93, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.9, i64 0, i64 0), i8* %102)
br label %179
104: ; preds = %87
%105 = load i8*, i8** %9
%106 = call i64 @strcmp(i8* %105, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0))
%107 = icmp eq i64 %106, 0
br i1 %107, label %108, label %121
108: ; preds = %104
%109 = load i8*, i8** %5
%110 = load i64, i64* %6
%111 = load i32, i32* %7
%112 = icmp sgt i32 %111, 1
br i1 %112, label %113, label %117
113: ; preds = %108
%114 = load i8**, i8*** %8
%115 = getelementptr inbounds i8*, i8** %114, i64 1
%116 = load i8*, i8** %115
br label %118
117: ; preds = %108
br label %118
118: ; preds = %117, %113
%119 = phi i8* [ %116, %113 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0), %117 ]
%120 = call i32 (i8*, i64, i8*, i8*, ...) @snprintf(i8* %109, i64 %110, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.11, i64 0, i64 0), i8* %119)
br label %178
121: ; preds = %104
%122 = load i8*, i8** %9
%123 = call i64 @strcmp(i8* %122, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.12, i64 0, i64 0))
%124 = icmp eq i64 %123, 0
br i1 %124, label %125, label %138
125: ; preds = %121
%126 = load i8*, i8** %5
%127 = load i64, i64* %6
%128 = load i32, i32* %7
%129 = icmp sgt i32 %128, 1
br i1 %129, label %130, label %134
130: ; preds = %125
%131 = load i8**, i8*** %8
%132 = getelementptr inbounds i8*, i8** %131, i64 1
%133 = load i8*, i8** %132
br label %135
134: ; preds = %125
br label %135
135: ; preds = %134, %130
%136 = phi i8* [ %133, %130 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0), %134 ]
%137 = call i32 (i8*, i64, i8*, i8*, ...) @snprintf(i8* %126, i64 %127, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.13, i64 0, i64 0), i8* %136)
br label %177
138: ; preds = %121
%139 = load i8*, i8** %9
%140 = call i64 @strcmp(i8* %139, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.14, i64 0, i64 0))
%141 = icmp eq i64 %140, 0
br i1 %141, label %142, label %155
142: ; preds = %138
%143 = load i8*, i8** %5
%144 = load i64, i64* %6
%145 = load i32, i32* %7
%146 = icmp sgt i32 %145, 1
br i1 %146, label %147, label %151
147: ; preds = %142
%148 = load i8**, i8*** %8
%149 = getelementptr inbounds i8*, i8** %148, i64 1
%150 = load i8*, i8** %149
br label %152
151: ; preds = %142
br label %152
152: ; preds = %151, %147
%153 = phi i8* [ %150, %147 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0), %151 ]
%154 = call i32 (i8*, i64, i8*, i8*, ...) @snprintf(i8* %143, i64 %144, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.15, i64 0, i64 0), i8* %153)
br label %176
155: ; preds = %138
%156 = load i8*, i8** %9
%157 = call i64 @strcmp(i8* %156, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.16, i64 0, i64 0))
%158 = icmp eq i64 %157, 0
br i1 %158, label %159, label %162
159: ; preds = %155
%160 = load i8*, i8** %5
%161 = call i32 @strcpy(i8* %160, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.17, i64 0, i64 0))
br label %175
162: ; preds = %155
%163 = load i8*, i8** %9
%164 = call i64 @strcmp(i8* %163, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.18, i64 0, i64 0))
%165 = icmp eq i64 %164, 0
br i1 %165, label %166, label %169
166: ; preds = %162
%167 = load i8*, i8** %5
%168 = call i32 @strcpy(i8* %167, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.19, i64 0, i64 0))
br label %174
169: ; preds = %162
%170 = load i8*, i8** %5
%171 = load i64, i64* %6
%172 = load i8*, i8** %9
%173 = call i32 (i8*, i64, i8*, i8*, ...) @snprintf(i8* %170, i64 %171, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.20, i64 0, i64 0), i8* %172)
br label %174
174: ; preds = %169, %166
br label %175
175: ; preds = %174, %159
br label %176
176: ; preds = %175, %152
br label %177
177: ; preds = %176, %135
br label %178
178: ; preds = %177, %118
br label %179
179: ; preds = %178, %101
br label %180
180: ; preds = %179, %84
br label %181
181: ; preds = %180, %60
%182 = load i8*, i8** %5
%183 = load i64, i64* %6
%184 = sub i64 %183, 1
%185 = getelementptr inbounds i8, i8* %182, i64 %184
store i8 0, i8* %185
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"load\00"
@.str.1 = [5 x i8] c"true\00"
@.str.2 = [28 x i8] c"ATTACH_LOADAGENTPATH(%s,%s)\00"
@.str.3 = [1 x i8] zeroinitializer
@.str.4 = [24 x i8] c"ATTACH_LOADAGENT(%s,%s)\00"
@.str.5 = [5 x i8] c"jcmd\00"
@.str.6 = [25 x i8] c"ATTACH_DIAGNOSTICS:%s,%s\00"
@.str.7 = [5 x i8] c"help\00"
@.str.8 = [11 x i8] c"threaddump\00"
@.str.9 = [35 x i8] c"ATTACH_DIAGNOSTICS:Thread.print,%s\00"
@.str.10 = [9 x i8] c"dumpheap\00"
@.str.11 = [32 x i8] c"ATTACH_DIAGNOSTICS:Dump.heap,%s\00"
@.str.12 = [12 x i8] c"inspectheap\00"
@.str.13 = [41 x i8] c"ATTACH_DIAGNOSTICS:GC.class_histogram,%s\00"
@.str.14 = [9 x i8] c"datadump\00"
@.str.15 = [32 x i8] c"ATTACH_DIAGNOSTICS:Dump.java,%s\00"
@.str.16 = [11 x i8] c"properties\00"
@.str.17 = [27 x i8] c"ATTACH_GETSYSTEMPROPERTIES\00"
@.str.18 = [16 x i8] c"agentProperties\00"
@.str.19 = [26 x i8] c"ATTACH_GETAGENTPROPERTIES\00"
@.str.20 = [3 x i8] c"%s\00"
define void @translate_command(i8* %0, i64 %1, i32 %2, i8** nocapture %3) {
%5 = load i8*, i8** %3
%6 = tail call i64 @strcmp(i8* %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%7 = icmp eq i64 %6, 0
%8 = icmp sgt i32 %2, 1
%9 = and i1 %8, %7
br i1 %9, label %10, label %38
10: ; preds = %4
%11 = icmp ugt i32 %2, 2
br i1 %11, label %15, label %12
12: ; preds = %10
%13 = getelementptr inbounds i8*, i8** %3, i64 1
%14 = load i8*, i8** %13
br label %34
15: ; preds = %10
%16 = getelementptr inbounds i8*, i8** %3, i64 2
%17 = load i8*, i8** %16
%18 = tail call i64 @strcmp(i8* %17, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%19 = icmp eq i64 %18, 0
%20 = getelementptr inbounds i8*, i8** %3, i64 1
%21 = load i8*, i8** %20
%22 = icmp eq i32 %2, 3
br i1 %19, label %23, label %30
23: ; preds = %15
br i1 %22, label %27, label %24
24: ; preds = %23
%25 = getelementptr inbounds i8*, i8** %3, i64 3
%26 = load i8*, i8** %25
br label %27
27: ; preds = %23, %24
%28 = phi i8* [ %26, %24 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0), %23 ]
%29 = tail call i32 (i8*, i64, i8*, i8*, ...) @snprintf(i8* %0, i64 %1, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i8* %21, i8* %28)
br label %105
30: ; preds = %15
br i1 %22, label %34, label %31
31: ; preds = %30
%32 = getelementptr inbounds i8*, i8** %3, i64 3
%33 = load i8*, i8** %32
br label %34
34: ; preds = %12, %30, %31
%35 = phi i8* [ %21, %31 ], [ %21, %30 ], [ %14, %12 ]
%36 = phi i8* [ %33, %31 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0), %30 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0), %12 ]
%37 = tail call i32 (i8*, i64, i8*, i8*, ...) @snprintf(i8* %0, i64 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0), i8* %35, i8* %36)
br label %105
38: ; preds = %4
%39 = tail call i64 @strcmp(i8* %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%40 = icmp eq i64 %39, 0
br i1 %40, label %41, label %53
41: ; preds = %38
br i1 %8, label %42, label %49
42: ; preds = %41
%43 = getelementptr inbounds i8*, i8** %3, i64 1
%44 = load i8*, i8** %43
%45 = icmp eq i32 %2, 2
br i1 %45, label %49, label %46
46: ; preds = %42
%47 = getelementptr inbounds i8*, i8** %3, i64 2
%48 = load i8*, i8** %47
br label %49
49: ; preds = %41, %42, %46
%50 = phi i8* [ %44, %46 ], [ %44, %42 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), %41 ]
%51 = phi i8* [ %48, %46 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0), %42 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0), %41 ]
%52 = tail call i32 (i8*, i64, i8*, i8*, ...) @snprintf(i8* %0, i64 %1, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.6, i64 0, i64 0), i8* %50, i8* %51)
br label %105
53: ; preds = %38
%54 = tail call i64 @strcmp(i8* %5, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0))
%55 = icmp eq i64 %54, 0
br i1 %55, label %56, label %63
56: ; preds = %53
br i1 %8, label %57, label %60
57: ; preds = %56
%58 = getelementptr inbounds i8*, i8** %3, i64 1
%59 = load i8*, i8** %58
br label %60
60: ; preds = %56, %57
%61 = phi i8* [ %59, %57 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0), %56 ]
%62 = tail call i32 (i8*, i64, i8*, i8*, ...) @snprintf(i8* %0, i64 %1, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.9, i64 0, i64 0), i8* %61)
br label %105
63: ; preds = %53
%64 = tail call i64 @strcmp(i8* %5, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0))
%65 = icmp eq i64 %64, 0
br i1 %65, label %66, label %73
66: ; preds = %63
br i1 %8, label %67, label %70
67: ; preds = %66
%68 = getelementptr inbounds i8*, i8** %3, i64 1
%69 = load i8*, i8** %68
br label %70
70: ; preds = %66, %67
%71 = phi i8* [ %69, %67 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0), %66 ]
%72 = tail call i32 (i8*, i64, i8*, i8*, ...) @snprintf(i8* %0, i64 %1, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.11, i64 0, i64 0), i8* %71)
br label %105
73: ; preds = %63
%74 = tail call i64 @strcmp(i8* %5, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.12, i64 0, i64 0))
%75 = icmp eq i64 %74, 0
br i1 %75, label %76, label %83
76: ; preds = %73
br i1 %8, label %77, label %80
77: ; preds = %76
%78 = getelementptr inbounds i8*, i8** %3, i64 1
%79 = load i8*, i8** %78
br label %80
80: ; preds = %76, %77
%81 = phi i8* [ %79, %77 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0), %76 ]
%82 = tail call i32 (i8*, i64, i8*, i8*, ...) @snprintf(i8* %0, i64 %1, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.13, i64 0, i64 0), i8* %81)
br label %105
83: ; preds = %73
%84 = tail call i64 @strcmp(i8* %5, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.14, i64 0, i64 0))
%85 = icmp eq i64 %84, 0
br i1 %85, label %86, label %93
86: ; preds = %83
br i1 %8, label %87, label %90
87: ; preds = %86
%88 = getelementptr inbounds i8*, i8** %3, i64 1
%89 = load i8*, i8** %88
br label %90
90: ; preds = %86, %87
%91 = phi i8* [ %89, %87 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0), %86 ]
%92 = tail call i32 (i8*, i64, i8*, i8*, ...) @snprintf(i8* %0, i64 %1, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.15, i64 0, i64 0), i8* %91)
br label %105
93: ; preds = %83
%94 = tail call i64 @strcmp(i8* %5, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.16, i64 0, i64 0))
%95 = icmp eq i64 %94, 0
br i1 %95, label %96, label %98
96: ; preds = %93
%97 = tail call i32 @strcpy(i8* %0, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.17, i64 0, i64 0))
br label %105
98: ; preds = %93
%99 = tail call i64 @strcmp(i8* %5, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.18, i64 0, i64 0))
%100 = icmp eq i64 %99, 0
br i1 %100, label %101, label %103
101: ; preds = %98
%102 = tail call i32 @strcpy(i8* %0, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.19, i64 0, i64 0))
br label %105
103: ; preds = %98
%104 = tail call i32 (i8*, i64, i8*, i8*, ...) @snprintf(i8* %0, i64 %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.20, i64 0, i64 0), i8* %5)
br label %105
105: ; preds = %49, %70, %90, %101, %103, %96, %80, %60, %27, %34
%106 = add i64 %1, -1
%107 = getelementptr inbounds i8, i8* %0, i64 %106
store i8 0, i8* %107
ret void
}