#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 ssize_t;
typedef int /*<<< orphan*/ cmdlinePath;

/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int PATH_MAX;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ free(char *);
char *malloc(int);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int open(char *, int /*<<< orphan*/);
int read(int, char *, int);
int /*<<< orphan*/ snprintf(char *, int, char *, int const);
int /*<<< orphan*/ strncpy(char *, char *, int);
int cmdlineByPID(const int pid, char *dst, ssize_t len) {
  char cmdlinePath[PATH_MAX];
  char *buffer;
  ssize_t bufferLen = 0;
  int fd, offset;
  memset(cmdlinePath, 0, sizeof(cmdlinePath));
  memset(dst, 0, len);
  snprintf(cmdlinePath, sizeof(cmdlinePath), "/proc/%d/cmdline", pid);
  fd = open(cmdlinePath, O_RDONLY);
  if (fd == -1) {
    return (0);
  }
  buffer = malloc(4096);
  if (buffer == NULL) {
    close(fd);
    return (-1);
  }
  bufferLen = 4096;
  memset(buffer, 0, bufferLen);
  bufferLen = read(fd, buffer, bufferLen);
  close(fd);
  if (bufferLen == -1) {
    return (bufferLen);
  }
  for (offset = 0; offset < bufferLen - 1; offset++) {
    if (*(buffer + offset) == '\0') {
      *(buffer + offset) = ' ';
    }
  }
  for (offset = bufferLen; offset >= 0; offset--) {
    if ((*(buffer + offset) == '\0') || (*(buffer + offset) == ' ')) {
      *(buffer + offset) = '\0';
    } else {
      break;
    }
  }
  strncpy(dst, buffer, len);
  free(buffer);
  return (0);
}


x86 assembly (clang, -O0):
<cmdlineByPID>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    0x2e57(%rip),%rax
mov    (%rax),%eax
mov    %rax,-0x50(%rbp)
mov    %rsp,%rcx
mov    %rcx,-0x20(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x48(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x34(%rbp)
mov    %eax,%edx
xor    %esi,%esi
call   1060 <memset@plt>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
xor    %esi,%esi
call   1060 <memset@plt>
mov    -0x48(%rbp),%rdi
mov    -0x50(%rbp),%rax
mov    %eax,%esi
mov    -0x8(%rbp),%ecx
lea    0xe0c(%rip),%rdx
call   1050 <snprintf@plt>
mov    -0x48(%rbp),%rdi
mov    0x2ddc(%rip),%rax
mov    (%rax),%esi
call   10a0 <open@plt>
mov    %eax,-0x38(%rbp)
cmpl   $0xffffffff,-0x38(%rbp)
jne    122b <cmdlineByPID+0xab>
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x40(%rbp)
jmp    1380 <cmdlineByPID+0x200>
mov    $0x1000,%edi
call   1090 <malloc@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
jne    125f <cmdlineByPID+0xdf>
mov    -0x38(%rbp),%edi
call   1070 <close@plt>
movl   $0xffffffff,-0x4(%rbp)
movl   $0x1,-0x40(%rbp)
jmp    1380 <cmdlineByPID+0x200>
movl   $0x1000,-0x34(%rbp)
mov    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%edx
xor    %esi,%esi
call   1060 <memset@plt>
mov    -0x38(%rbp),%edi
mov    -0x30(%rbp),%rsi
mov    -0x34(%rbp),%edx
call   1080 <read@plt>
mov    %eax,-0x34(%rbp)
mov    -0x38(%rbp),%edi
call   1070 <close@plt>
cmpl   $0xffffffff,-0x34(%rbp)
jne    12aa <cmdlineByPID+0x12a>
mov    -0x34(%rbp),%eax
mov    %eax,-0x4(%rbp)
movl   $0x1,-0x40(%rbp)
jmp    1380 <cmdlineByPID+0x200>
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
mov    -0x34(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    12f6 <cmdlineByPID+0x176>
mov    -0x30(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
jne    12e3 <cmdlineByPID+0x163>
mov    -0x30(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movb   $0x20,(%rax,%rcx,1)
jmp    12e8 <cmdlineByPID+0x168>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    12b1 <cmdlineByPID+0x131>
mov    -0x34(%rbp),%eax
mov    %eax,-0x3c(%rbp)
cmpl   $0x0,-0x3c(%rbp)
jl     1359 <cmdlineByPID+0x1d9>
mov    -0x30(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1330 <cmdlineByPID+0x1b0>
mov    -0x30(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x20,%eax
jne    1341 <cmdlineByPID+0x1c1>
mov    -0x30(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
jmp    1346 <cmdlineByPID+0x1c6>
jmp    1359 <cmdlineByPID+0x1d9>
jmp    134b <cmdlineByPID+0x1cb>
mov    -0x3c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x3c(%rbp)
jmp    12fc <cmdlineByPID+0x17c>
mov    -0x10(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <strncpy@plt>
mov    -0x30(%rbp),%rdi
call   1030 <free@plt>
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x40(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmdlineByPID>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %edx,%r15d
mov    %rsi,%r12
mov    %edi,-0x30(%rbp)
mov    0x2e4f(%rip),%rax
mov    (%rax),%r13d
mov    %rsp,%rbx
mov    %r13,%rax
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
xor    %r14d,%r14d
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r13d,%edx
call   1060 <memset@plt>
mov    %r12,-0x38(%rbp)
mov    %r12,%rdi
xor    %esi,%esi
mov    %r15d,-0x2c(%rbp)
mov    %r15d,%edx
call   1060 <memset@plt>
lea    0xe1c(%rip),%rdx
mov    %rbx,%rdi
mov    %r13d,%esi
mov    -0x30(%rbp),%ecx
call   1050 <snprintf@plt>
mov    0x2de7(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   10a0 <open@plt>
cmp    $0xffffffff,%eax
je     146c <cmdlineByPID+0x2ec>
mov    %eax,%r13d
mov    $0x1000,%edi
call   1090 <malloc@plt>
test   %rax,%rax
je     126c <cmdlineByPID+0xec>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    $0x1000,%edx
call   1060 <memset@plt>
mov    %r13d,%edi
mov    %rbx,%rsi
mov    $0x1000,%edx
call   1080 <read@plt>
mov    %eax,%r12d
mov    %r13d,%edi
call   1070 <close@plt>
cmp    $0xffffffff,%r12d
je     1274 <cmdlineByPID+0xf4>
cmp    $0x2,%r12d
jl     142b <cmdlineByPID+0x2ab>
lea    -0x1(%r12),%eax
cmp    $0x10,%eax
jae    127f <cmdlineByPID+0xff>
xor    %ecx,%ecx
jmp    1489 <cmdlineByPID+0x309>
mov    %r13d,%edi
call   1070 <close@plt>
mov    $0xffffffff,%r14d
jmp    146c <cmdlineByPID+0x2ec>
mov    %eax,%ecx
and    $0xfffffff0,%ecx
xor    %edx,%edx
pxor   %xmm0,%xmm0
jmp    129d <cmdlineByPID+0x11d>
nopl   0x0(%rax)
add    $0x10,%rdx
cmp    %rdx,%rcx
je     1426 <cmdlineByPID+0x2a6>
movq   (%rbx,%rdx,1),%xmm2
movdqa %xmm2,%xmm1
pcmpeqb %xmm0,%xmm1
movd   %xmm1,%esi
test   $0x1,%sil
je     12b8 <cmdlineByPID+0x138>
movb   $0x20,(%rbx,%rdx,1)
movdqa %xmm1,%xmm3
pslld  $0x8,%xmm3
movd   %xmm3,%esi
shr    $0x10,%esi
test   $0x1,%sil
je     12d3 <cmdlineByPID+0x153>
movb   $0x20,0x1(%rbx,%rdx,1)
pshuflw $0x55,%xmm2,%xmm3
pcmpeqb %xmm0,%xmm3
pextrw $0x2,%xmm3,%esi
test   $0x1,%sil
je     12ec <cmdlineByPID+0x16c>
movb   $0x20,0x2(%rbx,%rdx,1)
movdqa %xmm1,%xmm3
psllq  $0x18,%xmm3
pextrw $0x3,%xmm3,%esi
test   $0x1,%sil
je     1305 <cmdlineByPID+0x185>
movb   $0x20,0x3(%rbx,%rdx,1)
pshufd $0x55,%xmm2,%xmm2
pcmpeqb %xmm0,%xmm2
pextrw $0x4,%xmm2,%esi
test   $0x1,%sil
je     131e <cmdlineByPID+0x19e>
movb   $0x20,0x4(%rbx,%rdx,1)
movdqa %xmm1,%xmm2
pslldq $0x5,%xmm2
pextrw $0x5,%xmm2,%esi
test   $0x1,%sil
je     1337 <cmdlineByPID+0x1b7>
movb   $0x20,0x5(%rbx,%rdx,1)
pextrw $0x3,%xmm1,%esi
test   $0x1,%sil
je     1347 <cmdlineByPID+0x1c7>
movb   $0x20,0x6(%rbx,%rdx,1)
pslldq $0x7,%xmm1
pextrw $0x7,%xmm1,%esi
test   $0x1,%sil
je     135c <cmdlineByPID+0x1dc>
movb   $0x20,0x7(%rbx,%rdx,1)
movq   0x8(%rbx,%rdx,1),%xmm2
movdqa %xmm2,%xmm1
pcmpeqb %xmm0,%xmm1
movd   %xmm1,%esi
test   $0x1,%sil
je     1379 <cmdlineByPID+0x1f9>
movb   $0x20,0x8(%rbx,%rdx,1)
movdqa %xmm1,%xmm3
pslld  $0x8,%xmm3
movd   %xmm3,%esi
shr    $0x10,%esi
test   $0x1,%sil
je     1394 <cmdlineByPID+0x214>
movb   $0x20,0x9(%rbx,%rdx,1)
pshuflw $0x55,%xmm2,%xmm3
pcmpeqb %xmm0,%xmm3
pextrw $0x2,%xmm3,%esi
test   $0x1,%sil
je     13ad <cmdlineByPID+0x22d>
movb   $0x20,0xa(%rbx,%rdx,1)
movdqa %xmm1,%xmm3
psllq  $0x18,%xmm3
pextrw $0x3,%xmm3,%esi
test   $0x1,%sil
je     13c6 <cmdlineByPID+0x246>
movb   $0x20,0xb(%rbx,%rdx,1)
pshufd $0x55,%xmm2,%xmm2
pcmpeqb %xmm0,%xmm2
pextrw $0x4,%xmm2,%esi
test   $0x1,%sil
je     13df <cmdlineByPID+0x25f>
movb   $0x20,0xc(%rbx,%rdx,1)
movdqa %xmm1,%xmm2
pslldq $0x5,%xmm2
pextrw $0x5,%xmm2,%esi
test   $0x1,%sil
je     13f8 <cmdlineByPID+0x278>
movb   $0x20,0xd(%rbx,%rdx,1)
pextrw $0x3,%xmm1,%esi
test   $0x1,%sil
je     1408 <cmdlineByPID+0x288>
movb   $0x20,0xe(%rbx,%rdx,1)
pslldq $0x7,%xmm1
pextrw $0x7,%xmm1,%esi
test   $0x1,%sil
je     1290 <cmdlineByPID+0x110>
movb   $0x20,0xf(%rbx,%rdx,1)
jmp    1290 <cmdlineByPID+0x110>
cmp    %rax,%rcx
jne    1489 <cmdlineByPID+0x309>
test   %r12d,%r12d
js     1452 <cmdlineByPID+0x2d2>
mov    %r12d,%eax
add    $0x1,%rax
nopw   0x0(%rax,%rax,1)
testb  $0xdf,-0x1(%rbx,%rax,1)
jne    1452 <cmdlineByPID+0x2d2>
movb   $0x0,-0x1(%rbx,%rax,1)
add    $0xffffffffffffffff,%rax
jg     1440 <cmdlineByPID+0x2c0>
mov    -0x38(%rbp),%rdi
mov    %rbx,%rsi
mov    -0x2c(%rbp),%edx
call   1040 <strncpy@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %r14d,%r14d
mov    %r14d,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
xchg   %ax,%ax
add    $0x1,%rcx
cmp    %rcx,%rax
je     142b <cmdlineByPID+0x2ab>
cmpb   $0x0,(%rbx,%rcx,1)
jne    1480 <cmdlineByPID+0x300>
movb   $0x20,(%rbx,%rcx,1)
jmp    1480 <cmdlineByPID+0x300>

LLVM IR (-O0):
@PATH_MAX = global i32 0
@.str = [17 x i8] c"/proc/%d/cmdline\00"
@O_RDONLY = global i32 0
define i32 @cmdlineByPID(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i64
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i32 %2, i32* %7
%15 = load i32, i32* @PATH_MAX
%16 = zext i32 %15 to i64
%17 = call i8* @llvm.stacksave()
store i8* %17, i8** %8
%18 = alloca i8, i64 %16
store i64 %16, i64* %9
store i32 0, i32* %11
%19 = trunc i64 %16 to i32
%20 = call i32 @memset(i8* %18, i32 0, i32 %19)
%21 = load i8*, i8** %6
%22 = load i32, i32* %7
%23 = call i32 @memset(i8* %21, i32 0, i32 %22)
%24 = trunc i64 %16 to i32
%25 = load i32, i32* %5
%26 = call i32 @snprintf(i8* %18, i32 %24, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %25)
%27 = load i32, i32* @O_RDONLY
%28 = call i32 @open(i8* %18, i32 %27)
store i32 %28, i32* %12
%29 = load i32, i32* %12
%30 = icmp eq i32 %29, -1
br i1 %30, label %31, label %32
31: ; preds = %3
store i32 0, i32* %4
store i32 1, i32* %14
br label %114
32: ; preds = %3
%33 = call i8* @malloc(i32 4096)
store i8* %33, i8** %10
%34 = load i8*, i8** %10
%35 = icmp eq i8* %34, null
br i1 %35, label %36, label %39
36: ; preds = %32
%37 = load i32, i32* %12
%38 = call i32 @close(i32 %37)
store i32 -1, i32* %4
store i32 1, i32* %14
br label %114
39: ; preds = %32
store i32 4096, i32* %11
%40 = load i8*, i8** %10
%41 = load i32, i32* %11
%42 = call i32 @memset(i8* %40, i32 0, i32 %41)
%43 = load i32, i32* %12
%44 = load i8*, i8** %10
%45 = load i32, i32* %11
%46 = call i32 @read(i32 %43, i8* %44, i32 %45)
store i32 %46, i32* %11
%47 = load i32, i32* %12
%48 = call i32 @close(i32 %47)
%49 = load i32, i32* %11
%50 = icmp eq i32 %49, -1
br i1 %50, label %51, label %53
51: ; preds = %39
%52 = load i32, i32* %11
store i32 %52, i32* %4
store i32 1, i32* %14
br label %114
53: ; preds = %39
store i32 0, i32* %13
br label %54
54: ; preds = %73, %53
%55 = load i32, i32* %13
%56 = load i32, i32* %11
%57 = sub nsw i32 %56, 1
%58 = icmp slt i32 %55, %57
br i1 %58, label %59, label %76
59: ; preds = %54
%60 = load i8*, i8** %10
%61 = load i32, i32* %13
%62 = sext i32 %61 to i64
%63 = getelementptr inbounds i8, i8* %60, i64 %62
%64 = load i8, i8* %63
%65 = sext i8 %64 to i32
%66 = icmp eq i32 %65, 0
br i1 %66, label %67, label %72
67: ; preds = %59
%68 = load i8*, i8** %10
%69 = load i32, i32* %13
%70 = sext i32 %69 to i64
%71 = getelementptr inbounds i8, i8* %68, i64 %70
store i8 32, i8* %71
br label %72
72: ; preds = %67, %59
br label %73
73: ; preds = %72
%74 = load i32, i32* %13
%75 = add nsw i32 %74, 1
store i32 %75, i32* %13
br label %54
76: ; preds = %54
%77 = load i32, i32* %11
store i32 %77, i32* %13
br label %78
78: ; preds = %104, %76
%79 = load i32, i32* %13
%80 = icmp sge i32 %79, 0
br i1 %80, label %81, label %107
81: ; preds = %78
%82 = load i8*, i8** %10
%83 = load i32, i32* %13
%84 = sext i32 %83 to i64
%85 = getelementptr inbounds i8, i8* %82, i64 %84
%86 = load i8, i8* %85
%87 = sext i8 %86 to i32
%88 = icmp eq i32 %87, 0
br i1 %88, label %97, label %89
89: ; preds = %81
%90 = load i8*, i8** %10
%91 = load i32, i32* %13
%92 = sext i32 %91 to i64
%93 = getelementptr inbounds i8, i8* %90, i64 %92
%94 = load i8, i8* %93
%95 = sext i8 %94 to i32
%96 = icmp eq i32 %95, 32
br i1 %96, label %97, label %102
97: ; preds = %89, %81
%98 = load i8*, i8** %10
%99 = load i32, i32* %13
%100 = sext i32 %99 to i64
%101 = getelementptr inbounds i8, i8* %98, i64 %100
store i8 0, i8* %101
br label %103
102: ; preds = %89
br label %107
103: ; preds = %97
br label %104
104: ; preds = %103
%105 = load i32, i32* %13
%106 = add nsw i32 %105, -1
store i32 %106, i32* %13
br label %78
107: ; preds = %102, %78
%108 = load i8*, i8** %6
%109 = load i8*, i8** %10
%110 = load i32, i32* %7
%111 = call i32 @strncpy(i8* %108, i8* %109, i32 %110)
%112 = load i8*, i8** %10
%113 = call i32 @free(i8* %112)
store i32 0, i32* %4
store i32 1, i32* %14
br label %114
114: ; preds = %107, %51, %36, %31
%115 = load i8*, i8** %8
%116 = load i32, i32* %4
ret i32 %116
}

LLVM IR (-O2):
@PATH_MAX = global i32 0
@.str = [17 x i8] c"/proc/%d/cmdline\00"
@O_RDONLY = global i32 0
define i32 @cmdlineByPID(i32 %0, i8* %1, i32 %2) {
%4 = load i32, i32* @PATH_MAX
%5 = zext i32 %4 to i64
%6 = alloca i8, i64 %5
%7 = call i32 @memset(i8* %6, i32 0, i32 %4)
%8 = call i32 @memset(i8* %1, i32 0, i32 %2)
%9 = call i32 @snprintf(i8* %6, i32 %4, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %0)
%10 = load i32, i32* @O_RDONLY
%11 = call i32 @open(i8* %6, i32 %10)
%12 = icmp eq i32 %11, -1
br i1 %12, label %149, label %13
13: ; preds = %3
%14 = call dereferenceable_or_null(4096) i8* @malloc(i32 4096)
%15 = icmp eq i8* %14, null
br i1 %15, label %16, label %18
16: ; preds = %13
%17 = call i32 @close(i32 %11)
br label %149
18: ; preds = %13
%19 = call i32 @memset(i8* %14, i32 0, i32 4096)
%20 = call i32 @read(i32 %11, i8* %14, i32 4096)
%21 = call i32 @close(i32 %11)
%22 = icmp eq i32 %20, -1
br i1 %22, label %149, label %23
23: ; preds = %18
%24 = icmp sgt i32 %20, 1
br i1 %24, label %25, label %126
25: ; preds = %23
%26 = add nsw i32 %20, -1
%27 = zext i32 %26 to i64
%28 = icmp ult i32 %26, 16
br i1 %28, label %124, label %29
29: ; preds = %25
%30 = and i64 %27, 4294967280
br label %31
31: ; preds = %119, %29
%32 = phi i64 [ 0, %29 ], [ %120, %119 ]
%33 = or i64 %32, 8
%34 = getelementptr inbounds i8, i8* %14, i64 %32
%35 = bitcast i8* %34 to <8 x i8>*
%36 = load <8 x i8>, <8 x i8>* %35
%37 = getelementptr inbounds i8, i8* %34, i64 8
%38 = bitcast i8* %37 to <8 x i8>*
%39 = load <8 x i8>, <8 x i8>* %38
%40 = icmp eq <8 x i8> %36, zeroinitializer
%41 = icmp eq <8 x i8> %39, zeroinitializer
%42 = extractelement <8 x i1> %40, i64 0
br i1 %42, label %43, label %45
43: ; preds = %31
%44 = getelementptr inbounds i8, i8* %14, i64 %32
store i8 32, i8* %44
br label %45
45: ; preds = %43, %31
%46 = extractelement <8 x i1> %40, i64 1
br i1 %46, label %47, label %50
47: ; preds = %45
%48 = or i64 %32, 1
%49 = getelementptr inbounds i8, i8* %14, i64 %48
store i8 32, i8* %49
br label %50
50: ; preds = %47, %45
%51 = extractelement <8 x i1> %40, i64 2
br i1 %51, label %52, label %55
52: ; preds = %50
%53 = or i64 %32, 2
%54 = getelementptr inbounds i8, i8* %14, i64 %53
store i8 32, i8* %54
br label %55
55: ; preds = %52, %50
%56 = extractelement <8 x i1> %40, i64 3
br i1 %56, label %57, label %60
57: ; preds = %55
%58 = or i64 %32, 3
%59 = getelementptr inbounds i8, i8* %14, i64 %58
store i8 32, i8* %59
br label %60
60: ; preds = %57, %55
%61 = extractelement <8 x i1> %40, i64 4
br i1 %61, label %62, label %65
62: ; preds = %60
%63 = or i64 %32, 4
%64 = getelementptr inbounds i8, i8* %14, i64 %63
store i8 32, i8* %64
br label %65
65: ; preds = %62, %60
%66 = extractelement <8 x i1> %40, i64 5
br i1 %66, label %67, label %70
67: ; preds = %65
%68 = or i64 %32, 5
%69 = getelementptr inbounds i8, i8* %14, i64 %68
store i8 32, i8* %69
br label %70
70: ; preds = %67, %65
%71 = extractelement <8 x i1> %40, i64 6
br i1 %71, label %72, label %75
72: ; preds = %70
%73 = or i64 %32, 6
%74 = getelementptr inbounds i8, i8* %14, i64 %73
store i8 32, i8* %74
br label %75
75: ; preds = %72, %70
%76 = extractelement <8 x i1> %40, i64 7
br i1 %76, label %77, label %80
77: ; preds = %75
%78 = or i64 %32, 7
%79 = getelementptr inbounds i8, i8* %14, i64 %78
store i8 32, i8* %79
br label %80
80: ; preds = %77, %75
%81 = extractelement <8 x i1> %41, i64 0
br i1 %81, label %82, label %84
82: ; preds = %80
%83 = getelementptr inbounds i8, i8* %14, i64 %33
store i8 32, i8* %83
br label %84
84: ; preds = %82, %80
%85 = extractelement <8 x i1> %41, i64 1
br i1 %85, label %86, label %89
86: ; preds = %84
%87 = or i64 %32, 9
%88 = getelementptr inbounds i8, i8* %14, i64 %87
store i8 32, i8* %88
br label %89
89: ; preds = %86, %84
%90 = extractelement <8 x i1> %41, i64 2
br i1 %90, label %91, label %94
91: ; preds = %89
%92 = or i64 %32, 10
%93 = getelementptr inbounds i8, i8* %14, i64 %92
store i8 32, i8* %93
br label %94
94: ; preds = %91, %89
%95 = extractelement <8 x i1> %41, i64 3
br i1 %95, label %96, label %99
96: ; preds = %94
%97 = or i64 %32, 11
%98 = getelementptr inbounds i8, i8* %14, i64 %97
store i8 32, i8* %98
br label %99
99: ; preds = %96, %94
%100 = extractelement <8 x i1> %41, i64 4
br i1 %100, label %101, label %104
101: ; preds = %99
%102 = or i64 %32, 12
%103 = getelementptr inbounds i8, i8* %14, i64 %102
store i8 32, i8* %103
br label %104
104: ; preds = %101, %99
%105 = extractelement <8 x i1> %41, i64 5
br i1 %105, label %106, label %109
106: ; preds = %104
%107 = or i64 %32, 13
%108 = getelementptr inbounds i8, i8* %14, i64 %107
store i8 32, i8* %108
br label %109
109: ; preds = %106, %104
%110 = extractelement <8 x i1> %41, i64 6
br i1 %110, label %111, label %114
111: ; preds = %109
%112 = or i64 %32, 14
%113 = getelementptr inbounds i8, i8* %14, i64 %112
store i8 32, i8* %113
br label %114
114: ; preds = %111, %109
%115 = extractelement <8 x i1> %41, i64 7
br i1 %115, label %116, label %119
116: ; preds = %114
%117 = or i64 %32, 15
%118 = getelementptr inbounds i8, i8* %14, i64 %117
store i8 32, i8* %118
br label %119
119: ; preds = %116, %114
%120 = add nuw i64 %32, 16
%121 = icmp eq i64 %120, %30
br i1 %121, label %122, label %31
122: ; preds = %119
%123 = icmp eq i64 %30, %27
br i1 %123, label %126, label %124
124: ; preds = %25, %122
%125 = phi i64 [ 0, %25 ], [ %30, %122 ]
br label %130
126: ; preds = %136, %122, %23
%127 = icmp sgt i32 %20, -1
br i1 %127, label %128, label %146
128: ; preds = %126
%129 = zext i32 %20 to i64
br label %139
130: ; preds = %124, %136
%131 = phi i64 [ %137, %136 ], [ %125, %124 ]
%132 = getelementptr inbounds i8, i8* %14, i64 %131
%133 = load i8, i8* %132
%134 = icmp eq i8 %133, 0
br i1 %134, label %135, label %136
135: ; preds = %130
store i8 32, i8* %132
br label %136
136: ; preds = %130, %135
%137 = add nuw nsw i64 %131, 1
%138 = icmp eq i64 %137, %27
br i1 %138, label %126, label %130
139: ; preds = %128, %143
%140 = phi i64 [ %129, %128 ], [ %144, %143 ]
%141 = getelementptr inbounds i8, i8* %14, i64 %140
%142 = load i8, i8* %141
switch i8 %142, label %146 [
i8 0, label %143
i8 32, label %143
]
143: ; preds = %139, %139
store i8 0, i8* %141
%144 = add nsw i64 %140, -1
%145 = icmp sgt i64 %140, 0
br i1 %145, label %139, label %146
146: ; preds = %143, %139, %126
%147 = call i32 @strncpy(i8* %1, i8* %14, i32 %2)
%148 = call i32 @free(i8* %14)
br label %149
149: ; preds = %18, %3, %146, %16
%150 = phi i32 [ -1, %16 ], [ 0, %146 ], [ 0, %3 ], [ -1, %18 ]
ret i32 %150
}