#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__ add_ccnl_name(unsigned char *, char *);
scalar_t__ add_signature(unsigned char *, char *, unsigned char *, int);
scalar_t__ ccnl_ccnb_mkBlob(unsigned char *, int, int, char *, int);
int ccnl_ccnb_mkHeader(unsigned char *, int, int);
int ccnl_ccnb_mkStrBlob(unsigned char *, int, int, char *);
int /*<<< orphan*/ memcpy(unsigned char *, unsigned char *, int);
int mkRemoveFormRelayCacheRequest(unsigned char *out, char *ccn_path,
                                  char *private_key_path) {
  int len = 0, len1 = 0, len2 = 0, len3 = 0;
  unsigned char out1[8096];
  unsigned char contentobj[10000];
  unsigned char stmt[2000];
  len = ccnl_ccnb_mkHeader(out, 26, 2);
  len += ccnl_ccnb_mkHeader(out + len, 14, 2);
  len1 = ccnl_ccnb_mkStrBlob(out1, 15, 2, "ccnx");
  len1 += ccnl_ccnb_mkStrBlob(out1 + len1, 15, 2, "");
  len1 += ccnl_ccnb_mkStrBlob(out1 + len1, 15, 2, "removecacheobject");
  len3 = ccnl_ccnb_mkHeader(stmt, 19, 2);
  len3 += add_ccnl_name(stmt + len3, ccn_path);
  stmt[len3++] = 0;
  len2 = ccnl_ccnb_mkHeader(contentobj, 64, 2);
  len2 += ccnl_ccnb_mkBlob(contentobj + len2, 19, 2, (char *)stmt, len3);
  contentobj[len2++] = 0;
  len1 += ccnl_ccnb_mkBlob(out1 + len1, 15, 2, (char *)contentobj, len2);
  if (private_key_path)
    len += add_signature(out + len, private_key_path, out1, len1);
  memcpy(out + len, out1, len1);
  len += len1;
  out[len++] = 0;
  out[len++] = 0;
  return len;
}


x86 assembly (clang, -O0):
<mkRemoveFormRelayCacheRequest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x4eb0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1a,%esi
mov    $0x2,%edx
call   1080 <ccnl_ccnb_mkHeader@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0x1c(%rbp),%rax
add    %rax,%rdi
mov    $0xe,%esi
mov    $0x2,%edx
call   1080 <ccnl_ccnb_mkHeader@plt>
add    -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
lea    -0x1fd0(%rbp),%rdi
mov    $0xf,%esi
mov    $0x2,%edx
lea    0xe1f(%rip),%rcx
call   1040 <ccnl_ccnb_mkStrBlob@plt>
mov    %eax,-0x20(%rbp)
lea    -0x1fd0(%rbp),%rdi
movslq -0x20(%rbp),%rax
add    %rax,%rdi
mov    $0xf,%esi
mov    $0x2,%edx
lea    0xe0e(%rip),%rcx
call   1040 <ccnl_ccnb_mkStrBlob@plt>
add    -0x20(%rbp),%eax
mov    %eax,-0x20(%rbp)
lea    -0x1fd0(%rbp),%rdi
movslq -0x20(%rbp),%rax
add    %rax,%rdi
mov    $0xf,%esi
mov    $0x2,%edx
lea    0xdd3(%rip),%rcx
call   1040 <ccnl_ccnb_mkStrBlob@plt>
add    -0x20(%rbp),%eax
mov    %eax,-0x20(%rbp)
lea    -0x4eb0(%rbp),%rdi
mov    $0x13,%esi
mov    $0x2,%edx
call   1080 <ccnl_ccnb_mkHeader@plt>
mov    %eax,-0x28(%rbp)
lea    -0x4eb0(%rbp),%rdi
movslq -0x28(%rbp),%rax
add    %rax,%rdi
mov    -0x10(%rbp),%rsi
call   1070 <add_ccnl_name@plt>
mov    %rax,%rcx
movslq -0x28(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x28(%rbp)
cltq
movb   $0x0,-0x4eb0(%rbp,%rax,1)
lea    -0x46e0(%rbp),%rdi
mov    $0x40,%esi
mov    $0x2,%edx
call   1080 <ccnl_ccnb_mkHeader@plt>
mov    %eax,-0x24(%rbp)
lea    -0x46e0(%rbp),%rdi
movslq -0x24(%rbp),%rax
add    %rax,%rdi
lea    -0x4eb0(%rbp),%rcx
mov    -0x28(%rbp),%r8d
mov    $0x13,%esi
mov    $0x2,%edx
call   1050 <ccnl_ccnb_mkBlob@plt>
mov    %rax,%rcx
movslq -0x24(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x24(%rbp)
cltq
movb   $0x0,-0x46e0(%rbp,%rax,1)
lea    -0x1fd0(%rbp),%rdi
movslq -0x20(%rbp),%rax
add    %rax,%rdi
lea    -0x46e0(%rbp),%rcx
mov    -0x24(%rbp),%r8d
mov    $0xf,%esi
mov    $0x2,%edx
call   1050 <ccnl_ccnb_mkBlob@plt>
mov    %rax,%rcx
movslq -0x20(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x20(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     135d <mkRemoveFormRelayCacheRequest+0x1fd>
mov    -0x8(%rbp),%rdi
movslq -0x1c(%rbp),%rax
add    %rax,%rdi
mov    -0x18(%rbp),%rsi
lea    -0x1fd0(%rbp),%rdx
mov    -0x20(%rbp),%ecx
call   1030 <add_signature@plt>
mov    %rax,%rcx
movslq -0x1c(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0x1c(%rbp),%rax
add    %rax,%rdi
lea    -0x1fd0(%rbp),%rsi
mov    -0x20(%rbp),%edx
call   1060 <memcpy@plt>
mov    -0x20(%rbp),%eax
add    -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x1c(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x1c(%rbp)
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
mov    -0x1c(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x1c(%rbp)
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x1c(%rbp),%eax
add    $0x4eb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mkRemoveFormRelayCacheRequest>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x4e98,%rsp
mov    %rdx,0x8(%rsp)
mov    %rsi,%r15
mov    %rdi,%r12
mov    $0x1a,%esi
mov    $0x2,%edx
call   1080 <ccnl_ccnb_mkHeader@plt>
movslq %eax,%rbp
lea    (%r12,%rbp,1),%rdi
mov    $0xe,%esi
mov    $0x2,%edx
call   1080 <ccnl_ccnb_mkHeader@plt>
add    %eax,%ebp
lea    0xe56(%rip),%rcx
lea    0x7e0(%rsp),%rdi
mov    $0xf,%esi
mov    $0x2,%edx
call   1040 <ccnl_ccnb_mkStrBlob@plt>
movslq %eax,%rbx
lea    (%rsp,%rbx,1),%rdi
add    $0x7e0,%rdi
lea    0xe40(%rip),%rcx
mov    $0xf,%esi
mov    $0x2,%edx
call   1040 <ccnl_ccnb_mkStrBlob@plt>
add    %eax,%ebx
movslq %ebx,%r14
lea    (%rsp,%r14,1),%rdi
add    $0x7e0,%rdi
lea    0xe09(%rip),%rcx
mov    $0xf,%esi
mov    $0x2,%edx
call   1040 <ccnl_ccnb_mkStrBlob@plt>
add    %eax,%r14d
lea    0x10(%rsp),%rdi
mov    $0x13,%esi
mov    $0x2,%edx
call   1080 <ccnl_ccnb_mkHeader@plt>
movslq %eax,%rbx
lea    (%rsp,%rbx,1),%rdi
add    $0x10,%rdi
mov    %r15,%rsi
call   1070 <add_ccnl_name@plt>
mov    %ebx,%ecx
add    %eax,%ecx
add    %eax,%ebx
add    $0x1,%ebx
movslq %ecx,%rax
movb   $0x0,0x10(%rsp,%rax,1)
lea    0x2780(%rsp),%r15
mov    %r15,%rdi
mov    $0x40,%esi
mov    $0x2,%edx
call   1080 <ccnl_ccnb_mkHeader@plt>
movslq %eax,%r13
lea    (%rsp,%r13,1),%rdi
add    $0x2780,%rdi
mov    $0x13,%esi
mov    $0x2,%edx
lea    0x10(%rsp),%rcx
mov    %ebx,%r8d
call   1050 <ccnl_ccnb_mkBlob@plt>
lea    (%rax,%r13,1),%ecx
lea    (%rax,%r13,1),%r8d
add    $0x1,%r8d
movslq %ecx,%rax
movb   $0x0,0x2780(%rsp,%rax,1)
movslq %r14d,%rbx
lea    0x7e0(%rsp,%rbx,1),%rdi
mov    $0xf,%esi
mov    $0x2,%edx
mov    %r15,%rcx
call   1050 <ccnl_ccnb_mkBlob@plt>
mov    0x8(%rsp),%rsi
add    %eax,%ebx
test   %rsi,%rsi
je     12dd <mkRemoveFormRelayCacheRequest+0x17d>
movslq %ebp,%rbp
lea    (%r12,%rbp,1),%rdi
lea    0x7e0(%rsp),%rdx
mov    %ebx,%ecx
call   1030 <add_signature@plt>
add    %eax,%ebp
movslq %ebp,%rbp
lea    (%r12,%rbp,1),%rdi
lea    0x7e0(%rsp),%rsi
mov    %ebx,%edx
call   1060 <memcpy@plt>
lea    (%rbx,%rbp,1),%eax
cltq
movw   $0x0,(%r12,%rax,1)
lea    (%rbx,%rbp,1),%eax
add    $0x2,%eax
add    $0x4e98,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"ccnx\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [18 x i8] c"removecacheobject\00"
define i32 @mkRemoveFormRelayCacheRequest(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca [8096 x i8]
%12 = alloca [10000 x i8]
%13 = alloca [2000 x i8]
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
store i32 0, i32* %7
store i32 0, i32* %8
store i32 0, i32* %9
store i32 0, i32* %10
%14 = load i8*, i8** %4
%15 = call i32 @ccnl_ccnb_mkHeader(i8* %14, i32 26, i32 2)
store i32 %15, i32* %7
%16 = load i8*, i8** %4
%17 = load i32, i32* %7
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %16, i64 %18
%20 = call i32 @ccnl_ccnb_mkHeader(i8* %19, i32 14, i32 2)
%21 = load i32, i32* %7
%22 = add nsw i32 %21, %20
store i32 %22, i32* %7
%23 = getelementptr inbounds [8096 x i8], [8096 x i8]* %11, i64 0, i64 0
%24 = call i32 @ccnl_ccnb_mkStrBlob(i8* %23, i32 15, i32 2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i32 %24, i32* %8
%25 = getelementptr inbounds [8096 x i8], [8096 x i8]* %11, i64 0, i64 0
%26 = load i32, i32* %8
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds i8, i8* %25, i64 %27
%29 = call i32 @ccnl_ccnb_mkStrBlob(i8* %28, i32 15, i32 2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%30 = load i32, i32* %8
%31 = add nsw i32 %30, %29
store i32 %31, i32* %8
%32 = getelementptr inbounds [8096 x i8], [8096 x i8]* %11, i64 0, i64 0
%33 = load i32, i32* %8
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds i8, i8* %32, i64 %34
%36 = call i32 @ccnl_ccnb_mkStrBlob(i8* %35, i32 15, i32 2, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%37 = load i32, i32* %8
%38 = add nsw i32 %37, %36
store i32 %38, i32* %8
%39 = getelementptr inbounds [2000 x i8], [2000 x i8]* %13, i64 0, i64 0
%40 = call i32 @ccnl_ccnb_mkHeader(i8* %39, i32 19, i32 2)
store i32 %40, i32* %10
%41 = getelementptr inbounds [2000 x i8], [2000 x i8]* %13, i64 0, i64 0
%42 = load i32, i32* %10
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds i8, i8* %41, i64 %43
%45 = load i8*, i8** %5
%46 = call i64 @add_ccnl_name(i8* %44, i8* %45)
%47 = load i32, i32* %10
%48 = sext i32 %47 to i64
%49 = add nsw i64 %48, %46
%50 = trunc i64 %49 to i32
store i32 %50, i32* %10
%51 = load i32, i32* %10
%52 = add nsw i32 %51, 1
store i32 %52, i32* %10
%53 = sext i32 %51 to i64
%54 = getelementptr inbounds [2000 x i8], [2000 x i8]* %13, i64 0, i64 %53
store i8 0, i8* %54
%55 = getelementptr inbounds [10000 x i8], [10000 x i8]* %12, i64 0, i64 0
%56 = call i32 @ccnl_ccnb_mkHeader(i8* %55, i32 64, i32 2)
store i32 %56, i32* %9
%57 = getelementptr inbounds [10000 x i8], [10000 x i8]* %12, i64 0, i64 0
%58 = load i32, i32* %9
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds i8, i8* %57, i64 %59
%61 = getelementptr inbounds [2000 x i8], [2000 x i8]* %13, i64 0, i64 0
%62 = load i32, i32* %10
%63 = call i64 @ccnl_ccnb_mkBlob(i8* %60, i32 19, i32 2, i8* %61, i32 %62)
%64 = load i32, i32* %9
%65 = sext i32 %64 to i64
%66 = add nsw i64 %65, %63
%67 = trunc i64 %66 to i32
store i32 %67, i32* %9
%68 = load i32, i32* %9
%69 = add nsw i32 %68, 1
store i32 %69, i32* %9
%70 = sext i32 %68 to i64
%71 = getelementptr inbounds [10000 x i8], [10000 x i8]* %12, i64 0, i64 %70
store i8 0, i8* %71
%72 = getelementptr inbounds [8096 x i8], [8096 x i8]* %11, i64 0, i64 0
%73 = load i32, i32* %8
%74 = sext i32 %73 to i64
%75 = getelementptr inbounds i8, i8* %72, i64 %74
%76 = getelementptr inbounds [10000 x i8], [10000 x i8]* %12, i64 0, i64 0
%77 = load i32, i32* %9
%78 = call i64 @ccnl_ccnb_mkBlob(i8* %75, i32 15, i32 2, i8* %76, i32 %77)
%79 = load i32, i32* %8
%80 = sext i32 %79 to i64
%81 = add nsw i64 %80, %78
%82 = trunc i64 %81 to i32
store i32 %82, i32* %8
%83 = load i8*, i8** %6
%84 = icmp ne i8* %83, null
br i1 %84, label %85, label %98
85: ; preds = %3
%86 = load i8*, i8** %4
%87 = load i32, i32* %7
%88 = sext i32 %87 to i64
%89 = getelementptr inbounds i8, i8* %86, i64 %88
%90 = load i8*, i8** %6
%91 = getelementptr inbounds [8096 x i8], [8096 x i8]* %11, i64 0, i64 0
%92 = load i32, i32* %8
%93 = call i64 @add_signature(i8* %89, i8* %90, i8* %91, i32 %92)
%94 = load i32, i32* %7
%95 = sext i32 %94 to i64
%96 = add nsw i64 %95, %93
%97 = trunc i64 %96 to i32
store i32 %97, i32* %7
br label %98
98: ; preds = %85, %3
%99 = load i8*, i8** %4
%100 = load i32, i32* %7
%101 = sext i32 %100 to i64
%102 = getelementptr inbounds i8, i8* %99, i64 %101
%103 = getelementptr inbounds [8096 x i8], [8096 x i8]* %11, i64 0, i64 0
%104 = load i32, i32* %8
%105 = call i32 @memcpy(i8* %102, i8* %103, i32 %104)
%106 = load i32, i32* %8
%107 = load i32, i32* %7
%108 = add nsw i32 %107, %106
store i32 %108, i32* %7
%109 = load i8*, i8** %4
%110 = load i32, i32* %7
%111 = add nsw i32 %110, 1
store i32 %111, i32* %7
%112 = sext i32 %110 to i64
%113 = getelementptr inbounds i8, i8* %109, i64 %112
store i8 0, i8* %113
%114 = load i8*, i8** %4
%115 = load i32, i32* %7
%116 = add nsw i32 %115, 1
store i32 %116, i32* %7
%117 = sext i32 %115 to i64
%118 = getelementptr inbounds i8, i8* %114, i64 %117
store i8 0, i8* %118
%119 = load i32, i32* %7
ret i32 %119
}

LLVM IR (-O2):
@.str = [5 x i8] c"ccnx\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [18 x i8] c"removecacheobject\00"
define i32 @mkRemoveFormRelayCacheRequest(i8* %0, i8* %1, i8* %2) {
%4 = alloca [8096 x i8]
%5 = alloca [10000 x i8]
%6 = alloca [2000 x i8]
%7 = getelementptr inbounds [8096 x i8], [8096 x i8]* %4, i64 0, i64 0
%8 = getelementptr inbounds [10000 x i8], [10000 x i8]* %5, i64 0, i64 0
%9 = getelementptr inbounds [2000 x i8], [2000 x i8]* %6, i64 0, i64 0
%10 = tail call i32 @ccnl_ccnb_mkHeader(i8* %0, i32 26, i32 2)
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %0, i64 %11
%13 = tail call i32 @ccnl_ccnb_mkHeader(i8* %12, i32 14, i32 2)
%14 = add nsw i32 %13, %10
%15 = call i32 @ccnl_ccnb_mkStrBlob(i8* %7, i32 15, i32 2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [8096 x i8], [8096 x i8]* %4, i64 0, i64 %16
%18 = call i32 @ccnl_ccnb_mkStrBlob(i8* %17, i32 15, i32 2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%19 = add nsw i32 %18, %15
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [8096 x i8], [8096 x i8]* %4, i64 0, i64 %20
%22 = call i32 @ccnl_ccnb_mkStrBlob(i8* %21, i32 15, i32 2, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%23 = add nsw i32 %19, %22
%24 = call i32 @ccnl_ccnb_mkHeader(i8* %9, i32 19, i32 2)
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [2000 x i8], [2000 x i8]* %6, i64 0, i64 %25
%27 = call i64 @add_ccnl_name(i8* %26, i8* %1)
%28 = trunc i64 %27 to i32
%29 = add i32 %24, %28
%30 = add nsw i32 %29, 1
%31 = sext i32 %29 to i64
%32 = getelementptr inbounds [2000 x i8], [2000 x i8]* %6, i64 0, i64 %31
store i8 0, i8* %32
%33 = call i32 @ccnl_ccnb_mkHeader(i8* %8, i32 64, i32 2)
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds [10000 x i8], [10000 x i8]* %5, i64 0, i64 %34
%36 = call i64 @ccnl_ccnb_mkBlob(i8* %35, i32 19, i32 2, i8* %9, i32 %30)
%37 = trunc i64 %36 to i32
%38 = add i32 %33, %37
%39 = add nsw i32 %38, 1
%40 = sext i32 %38 to i64
%41 = getelementptr inbounds [10000 x i8], [10000 x i8]* %5, i64 0, i64 %40
store i8 0, i8* %41
%42 = sext i32 %23 to i64
%43 = getelementptr inbounds [8096 x i8], [8096 x i8]* %4, i64 0, i64 %42
%44 = call i64 @ccnl_ccnb_mkBlob(i8* %43, i32 15, i32 2, i8* %8, i32 %39)
%45 = trunc i64 %44 to i32
%46 = add i32 %23, %45
%47 = icmp eq i8* %2, null
br i1 %47, label %54, label %48
48: ; preds = %3
%49 = sext i32 %14 to i64
%50 = getelementptr inbounds i8, i8* %0, i64 %49
%51 = call i64 @add_signature(i8* %50, i8* %2, i8* %7, i32 %46)
%52 = trunc i64 %51 to i32
%53 = add i32 %14, %52
br label %54
54: ; preds = %48, %3
%55 = phi i32 [ %53, %48 ], [ %14, %3 ]
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds i8, i8* %0, i64 %56
%58 = call i32 @memcpy(i8* %57, i8* %7, i32 %46)
%59 = add nsw i32 %55, %46
%60 = add nsw i32 %59, 1
%61 = sext i32 %59 to i64
%62 = getelementptr inbounds i8, i8* %0, i64 %61
store i8 0, i8* %62
%63 = add nsw i32 %59, 2
%64 = sext i32 %60 to i64
%65 = getelementptr inbounds i8, i8* %0, i64 %64
store i8 0, i8* %65
ret i32 %63
}