#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*/ rnboundaryrn;
typedef int /*<<< orphan*/ rnboundaryEOF;
typedef int /*<<< orphan*/ boundaryrn;
typedef int /*<<< orphan*/ boundaryEOF;

/* Variables and functions */
int EOF;
int fgetc(int /*<<< orphan*/);
int /*<<< orphan*/ free(char *);
scalar_t__ malloc(int);
int /*<<< orphan*/ memcpy(char *, char *, int);
int /*<<< orphan*/ snprintf(char *, int, char *, char *);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ strcmp(char *, char *);
int strlen(char *);
char *_parse_multipart_value_into_memory(char *boundary, int *valuelen,
                                         bool *finish) {
  char boundaryEOF[256], rnboundaryEOF[256];
  char boundaryrn[256], rnboundaryrn[256];
  int boundarylen, boundaryEOFlen;
  char *value;
  int length;
  int c, c_count, mallocsize;
  snprintf(boundaryEOF, sizeof(boundaryEOF), "%s--", boundary);
  snprintf(rnboundaryEOF, sizeof(rnboundaryEOF), "\r\n%s--", boundary);
  snprintf(boundaryrn, sizeof(boundaryrn), "%s\r\n", boundary);
  snprintf(rnboundaryrn, sizeof(rnboundaryrn), "\r\n%s\r\n", boundary);
  boundarylen = strlen(boundary);
  boundaryEOFlen = strlen(boundaryEOF);
  for (value = NULL, length = 0, mallocsize = (16 * 1024), c_count = 0;
       (c = fgetc(stdin)) != EOF;) {
    if (c_count == 0) {
      value = (char *)malloc(sizeof(char) * mallocsize);
      if (value == NULL) {
        ;
        *finish = true;
        return NULL;
      }
    } else if (c_count == mallocsize - 1) {
      char *valuetmp;
      mallocsize *= 2;
      valuetmp = (char *)malloc(sizeof(char) * mallocsize);
      if (valuetmp == NULL) {
        ;
        free(value);
        *finish = true;
        return NULL;
      }
      memcpy(valuetmp, value, c_count);
      free(value);
      value = valuetmp;
    }
    value[c_count++] = (char)c;
    if ((c == '\n') || (c == '-')) {
      value[c_count] = '\0';
      if ((c_count - (2 + boundarylen + 2)) >= 0) {
        if (!strcmp(value + (c_count - (2 + boundarylen + 2)), rnboundaryrn)) {
          value[c_count - (2 + boundarylen + 2)] = '\0';
          length = c_count - (2 + boundarylen + 2);
          break;
        }
      }
      if ((c_count - (2 + boundaryEOFlen)) >= 0) {
        if (!strcmp(value + (c_count - (2 + boundaryEOFlen)), rnboundaryEOF)) {
          value[c_count - (2 + boundaryEOFlen)] = '\0';
          length = c_count - (2 + boundaryEOFlen);
          *finish = true;
          break;
        }
      }
      if ((c_count - (boundarylen + 2)) == 0) {
        if (!strcmp(value, boundaryrn)) {
          value[0] = '\0';
          length = 0;
          break;
        }
      }
      if ((c_count - boundaryEOFlen) == 0) {
        if (!strcmp(value, boundaryEOF)) {
          value[0] = '\0';
          length = 0;
          *finish = true;
          break;
        }
      }
    }
  }
  if (c == EOF) {
    ;
    if (value != NULL)
      free(value);
    *finish = true;
    return NULL;
  }
  *valuelen = length;
  return value;
}


x86 assembly (clang, -O0):
<_parse_multipart_value_into_memory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x450,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
lea    -0x120(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x100,%esi
lea    0xe64(%rip),%rdx
call   1050 <snprintf@plt>
lea    -0x220(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x100,%esi
lea    0xe46(%rip),%rdx
call   1050 <snprintf@plt>
lea    -0x320(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x100,%esi
lea    0xe33(%rip),%rdx
call   1050 <snprintf@plt>
lea    -0x420(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x100,%esi
lea    0xe15(%rip),%rdx
call   1050 <snprintf@plt>
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x424(%rbp)
lea    -0x120(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x428(%rbp)
movq   $0x0,-0x430(%rbp)
movl   $0x0,-0x434(%rbp)
movl   $0x4000,-0x440(%rbp)
movl   $0x0,-0x43c(%rbp)
mov    0x2da0(%rip),%rax
mov    (%rax),%edi
call   1060 <fgetc@plt>
mov    %eax,-0x438(%rbp)
mov    0x2d84(%rip),%rcx
cmp    (%rcx),%eax
je     1593 <_parse_multipart_value_into_memory+0x423>
cmpl   $0x0,-0x43c(%rbp)
jne    12b4 <_parse_multipart_value_into_memory+0x144>
movslq -0x440(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1090 <malloc@plt>
mov    %rax,-0x430(%rbp)
cmpq   $0x0,-0x430(%rbp)
jne    12af <_parse_multipart_value_into_memory+0x13f>
mov    -0x20(%rbp),%rax
movl   $0x1,(%rax)
movq   $0x0,-0x8(%rbp)
jmp    15f0 <_parse_multipart_value_into_memory+0x480>
jmp    135c <_parse_multipart_value_into_memory+0x1ec>
mov    -0x43c(%rbp),%eax
mov    -0x440(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jne    1357 <_parse_multipart_value_into_memory+0x1e7>
mov    -0x440(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x440(%rbp)
movslq -0x440(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1090 <malloc@plt>
mov    %rax,-0x448(%rbp)
cmpq   $0x0,-0x448(%rbp)
jne    1324 <_parse_multipart_value_into_memory+0x1b4>
mov    -0x430(%rbp),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rax
movl   $0x1,(%rax)
movq   $0x0,-0x8(%rbp)
jmp    15f0 <_parse_multipart_value_into_memory+0x480>
mov    -0x448(%rbp),%rdi
mov    -0x430(%rbp),%rsi
mov    -0x43c(%rbp),%edx
call   1080 <memcpy@plt>
mov    -0x430(%rbp),%rdi
call   1030 <free@plt>
mov    -0x448(%rbp),%rax
mov    %rax,-0x430(%rbp)
jmp    135c <_parse_multipart_value_into_memory+0x1ec>
mov    -0x438(%rbp),%eax
mov    %al,%dl
mov    -0x430(%rbp),%rax
mov    -0x43c(%rbp),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    %esi,-0x43c(%rbp)
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
cmpl   $0xa,-0x438(%rbp)
je     139c <_parse_multipart_value_into_memory+0x22c>
cmpl   $0x2d,-0x438(%rbp)
jne    158e <_parse_multipart_value_into_memory+0x41e>
mov    -0x430(%rbp),%rax
movslq -0x43c(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x43c(%rbp),%eax
mov    -0x424(%rbp),%ecx
add    $0x2,%ecx
add    $0x2,%ecx
sub    %ecx,%eax
cmp    $0x0,%eax
jl     1446 <_parse_multipart_value_into_memory+0x2d6>
mov    -0x430(%rbp),%rdi
mov    -0x43c(%rbp),%eax
mov    -0x424(%rbp),%ecx
add    $0x2,%ecx
add    $0x2,%ecx
sub    %ecx,%eax
cltq
add    %rax,%rdi
lea    -0x420(%rbp),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%eax
jne    1441 <_parse_multipart_value_into_memory+0x2d1>
mov    -0x430(%rbp),%rax
mov    -0x43c(%rbp),%ecx
mov    -0x424(%rbp),%edx
add    $0x2,%edx
add    $0x2,%edx
sub    %edx,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x43c(%rbp),%eax
mov    -0x424(%rbp),%ecx
add    $0x2,%ecx
add    $0x2,%ecx
sub    %ecx,%eax
mov    %eax,-0x434(%rbp)
jmp    1593 <_parse_multipart_value_into_memory+0x423>
jmp    1446 <_parse_multipart_value_into_memory+0x2d6>
mov    -0x43c(%rbp),%eax
mov    -0x428(%rbp),%ecx
add    $0x2,%ecx
sub    %ecx,%eax
cmp    $0x0,%eax
jl     14dc <_parse_multipart_value_into_memory+0x36c>
mov    -0x430(%rbp),%rdi
mov    -0x43c(%rbp),%eax
mov    -0x428(%rbp),%ecx
add    $0x2,%ecx
sub    %ecx,%eax
cltq
add    %rax,%rdi
lea    -0x220(%rbp),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%eax
jne    14d7 <_parse_multipart_value_into_memory+0x367>
mov    -0x430(%rbp),%rax
mov    -0x43c(%rbp),%ecx
mov    -0x428(%rbp),%edx
add    $0x2,%edx
sub    %edx,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x43c(%rbp),%eax
mov    -0x428(%rbp),%ecx
add    $0x2,%ecx
sub    %ecx,%eax
mov    %eax,-0x434(%rbp)
mov    -0x20(%rbp),%rax
movl   $0x1,(%rax)
jmp    1593 <_parse_multipart_value_into_memory+0x423>
jmp    14dc <_parse_multipart_value_into_memory+0x36c>
mov    -0x43c(%rbp),%eax
mov    -0x424(%rbp),%ecx
add    $0x2,%ecx
sub    %ecx,%eax
cmp    $0x0,%eax
jne    1530 <_parse_multipart_value_into_memory+0x3c0>
mov    -0x430(%rbp),%rdi
lea    -0x320(%rbp),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%eax
jne    152b <_parse_multipart_value_into_memory+0x3bb>
mov    -0x430(%rbp),%rax
movb   $0x0,(%rax)
movl   $0x0,-0x434(%rbp)
jmp    1593 <_parse_multipart_value_into_memory+0x423>
jmp    1530 <_parse_multipart_value_into_memory+0x3c0>
mov    -0x43c(%rbp),%eax
sub    -0x428(%rbp),%eax
cmp    $0x0,%eax
jne    1589 <_parse_multipart_value_into_memory+0x419>
mov    -0x430(%rbp),%rdi
lea    -0x120(%rbp),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%eax
jne    1584 <_parse_multipart_value_into_memory+0x414>
mov    -0x430(%rbp),%rax
movb   $0x0,(%rax)
movl   $0x0,-0x434(%rbp)
mov    -0x20(%rbp),%rax
movl   $0x1,(%rax)
jmp    1593 <_parse_multipart_value_into_memory+0x423>
jmp    1589 <_parse_multipart_value_into_memory+0x419>
jmp    158e <_parse_multipart_value_into_memory+0x41e>
jmp    1241 <_parse_multipart_value_into_memory+0xd1>
mov    -0x438(%rbp),%eax
mov    0x2a40(%rip),%rcx
cmp    (%rcx),%eax
jne    15d9 <_parse_multipart_value_into_memory+0x469>
cmpq   $0x0,-0x430(%rbp)
je     15c2 <_parse_multipart_value_into_memory+0x452>
mov    -0x430(%rbp),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rax
movl   $0x1,(%rax)
movq   $0x0,-0x8(%rbp)
jmp    15f0 <_parse_multipart_value_into_memory+0x480>
mov    -0x434(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x430(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x450,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_parse_multipart_value_into_memory>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x448,%rsp
mov    %rdx,%r15
mov    %rsi,%r12
mov    %rdi,%rbp
lea    0xe71(%rip),%rdx
lea    0x340(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x100,%esi
mov    %rbp,%rcx
call   1050 <snprintf@plt>
lea    0xe50(%rip),%rdx
lea    0x240(%rsp),%rdi
mov    $0x100,%esi
mov    %rbp,%rcx
call   1050 <snprintf@plt>
lea    0xe3d(%rip),%rdx
lea    0x140(%rsp),%rdi
mov    $0x100,%esi
mov    %rbp,%rcx
call   1050 <snprintf@plt>
lea    0xe1f(%rip),%rdx
lea    0x40(%rsp),%rdi
mov    $0x100,%esi
mov    %rbp,%rcx
call   1050 <snprintf@plt>
mov    %rbp,%rdi
call   1040 <strlen@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %eax,%ebx
mov    0x2dd3(%rip),%rax
mov    (%rax),%edi
call   1060 <fgetc@plt>
mov    %eax,%r14d
mov    0x2dba(%rip),%rax
cmp    (%rax),%r14d
jne    1243 <_parse_multipart_value_into_memory+0xd3>
cmp    (%rax),%r14d
je     143b <_parse_multipart_value_into_memory+0x2cb>
mov    %r12,0x10(%rsp)
xor    %r13d,%r13d
xor    %ebx,%ebx
jmp    1403 <_parse_multipart_value_into_memory+0x293>
mov    %r12,0x10(%rsp)
mov    %r15,0x8(%rsp)
lea    0x1(%rbp),%ecx
mov    %rcx,0x30(%rsp)
mov    %ebx,%ecx
not    %ebx
mov    %rbx,0x18(%rsp)
mov    $0xfffffffd,%edx
mov    %rbp,0x20(%rsp)
sub    %ebp,%edx
mov    %rdx,0x38(%rsp)
add    $0xffffffffffffffff,%rcx
mov    %rcx,0x28(%rsp)
mov    $0x4000,%r15d
xor    %ebx,%ebx
xor    %r13d,%r13d
mov    %rax,%r12
jmp    12af <_parse_multipart_value_into_memory+0x13f>
nopl   0x0(%rax,%rax,1)
mov    0x2d51(%rip),%rax
mov    (%rax),%edi
call   1060 <fgetc@plt>
mov    %eax,%r14d
add    $0x1,%rbx
cmp    (%r12),%eax
je     1426 <_parse_multipart_value_into_memory+0x2b6>
test   %rbx,%rbx
je     1300 <_parse_multipart_value_into_memory+0x190>
lea    -0x1(%r15),%eax
cmp    %rax,%rbx
jne    1314 <_parse_multipart_value_into_memory+0x1a4>
mov    %r12,%rbp
add    %r15d,%r15d
mov    %r15d,%edi
call   1090 <malloc@plt>
test   %rax,%rax
je     140c <_parse_multipart_value_into_memory+0x29c>
mov    %rax,%r12
mov    %rax,%rdi
mov    %r13,%rsi
mov    %ebx,%edx
call   1080 <memcpy@plt>
mov    %r13,%rdi
call   1030 <free@plt>
mov    %r12,%r13
mov    %rbp,%r12
jmp    1314 <_parse_multipart_value_into_memory+0x1a4>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r15d,%edi
call   1090 <malloc@plt>
mov    %rax,%r13
test   %rax,%rax
je     1414 <_parse_multipart_value_into_memory+0x2a4>
mov    %r14b,0x0(%r13,%rbx,1)
cmp    $0x2d,%r14d
je     1329 <_parse_multipart_value_into_memory+0x1b9>
cmp    $0xa,%r14d
jne    1290 <_parse_multipart_value_into_memory+0x120>
movb   $0x0,0x1(%r13,%rbx,1)
mov    0x38(%rsp),%rax
add    %rbx,%rax
test   %eax,%eax
js     1355 <_parse_multipart_value_into_memory+0x1e5>
mov    %eax,%ebp
add    %r13,%rbp
mov    %rbp,%rdi
lea    0x40(%rsp),%rsi
call   1070 <strcmp@plt>
test   %eax,%eax
je     13d7 <_parse_multipart_value_into_memory+0x267>
mov    0x18(%rsp),%rax
add    %rbx,%rax
test   %eax,%eax
js     137a <_parse_multipart_value_into_memory+0x20a>
mov    %eax,%ebp
add    %r13,%rbp
mov    %rbp,%rdi
lea    0x240(%rsp),%rsi
call   1070 <strcmp@plt>
test   %eax,%eax
je     13e4 <_parse_multipart_value_into_memory+0x274>
cmp    %rbx,0x30(%rsp)
jne    1399 <_parse_multipart_value_into_memory+0x229>
mov    %r13,%rdi
lea    0x140(%rsp),%rsi
call   1070 <strcmp@plt>
test   %eax,%eax
je     1421 <_parse_multipart_value_into_memory+0x2b1>
cmp    %rbx,0x28(%rsp)
jne    1290 <_parse_multipart_value_into_memory+0x120>
mov    %r13,%rdi
lea    0x340(%rsp),%rsi
call   1070 <strcmp@plt>
test   %eax,%eax
jne    1290 <_parse_multipart_value_into_memory+0x120>
movb   $0x0,0x0(%r13)
mov    0x8(%rsp),%r15
movl   $0x1,(%r15)
xor    %ebx,%ebx
cmp    (%r12),%r14d
jne    1403 <_parse_multipart_value_into_memory+0x293>
jmp    1433 <_parse_multipart_value_into_memory+0x2c3>
movb   $0x0,0x0(%rbp)
sub    0x20(%rsp),%ebx
add    $0xfffffffd,%ebx
jmp    1428 <_parse_multipart_value_into_memory+0x2b8>
movb   $0x0,0x0(%rbp)
mov    0x8(%rsp),%r15
movl   $0x1,(%r15)
mov    0x18(%rsp),%rax
add    %ebx,%eax
mov    %eax,%ebx
cmp    (%r12),%r14d
je     1433 <_parse_multipart_value_into_memory+0x2c3>
mov    0x10(%rsp),%rax
mov    %ebx,(%rax)
jmp    1445 <_parse_multipart_value_into_memory+0x2d5>
mov    %r13,%rdi
call   1030 <free@plt>
mov    0x8(%rsp),%rax
movl   $0x1,(%rax)
jmp    1442 <_parse_multipart_value_into_memory+0x2d2>
movb   $0x0,0x0(%r13)
xor    %ebx,%ebx
mov    0x8(%rsp),%r15
cmp    (%r12),%r14d
jne    1403 <_parse_multipart_value_into_memory+0x293>
mov    %r13,%rdi
call   1030 <free@plt>
movl   $0x1,(%r15)
xor    %r13d,%r13d
mov    %r13,%rax
add    $0x448,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%s--\00"
@.str.1 = [7 x i8] c"\0D\0A%s--\00"
@.str.2 = [5 x i8] c"%s\0D\0A\00"
@.str.3 = [7 x i8] c"\0D\0A%s\0D\0A\00"
@stdin = global i32 0
@EOF = global i32 0
define i8* @_parse_multipart_value_into_memory(i8* %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2) {
%4 = alloca [256 x i8]
%5 = alloca [256 x i8]
%6 = alloca [256 x i8]
%7 = alloca [256 x i8]
%8 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%9 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%10 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%11 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 0
%12 = call i32 @snprintf(i8* %8, i32 256, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0)
%13 = call i32 @snprintf(i8* %9, i32 256, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%14 = call i32 @snprintf(i8* %10, i32 256, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* %0)
%15 = call i32 @snprintf(i8* %11, i32 256, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i8* %0)
%16 = call i32 @strlen(i8* %0)
%17 = call i32 @strlen(i8* %8)
%18 = load i32, i32* @stdin
%19 = call i32 @fgetc(i32 %18)
%20 = load i32, i32* @EOF
%21 = icmp eq i32 %19, %20
br i1 %21, label %102, label %22
22: ; preds = %3
%23 = add nsw i32 %16, 1
%24 = zext i32 %23 to i64
%25 = zext i32 %17 to i64
%26 = xor i32 %17, -1
br label %27
27: ; preds = %22, %92
%28 = phi i64 [ 0, %22 ], [ %57, %92 ]
%29 = phi i32 [ %19, %22 ], [ %94, %92 ]
%30 = phi i32 [ 16384, %22 ], [ %55, %92 ]
%31 = phi i8* [ null, %22 ], [ %54, %92 ]
%32 = icmp eq i64 %28, 0
br i1 %32, label %33, label %38
33: ; preds = %27
%34 = call i64 @malloc(i32 %30)
%35 = inttoptr i64 %34 to i8*
%36 = icmp eq i64 %34, 0
br i1 %36, label %37, label %53
37: ; preds = %33
store i32 1, i32* %2
br label %111
38: ; preds = %27
%39 = add nsw i32 %30, -1
%40 = zext i32 %39 to i64
%41 = icmp eq i64 %28, %40
br i1 %41, label %42, label %53
42: ; preds = %38
%43 = shl nsw i32 %30, 1
%44 = call i64 @malloc(i32 %43)
%45 = inttoptr i64 %44 to i8*
%46 = icmp eq i64 %44, 0
br i1 %46, label %47, label %49
47: ; preds = %42
%48 = call i32 @free(i8* %31)
store i32 1, i32* %2
br label %111
49: ; preds = %42
%50 = trunc i64 %28 to i32
%51 = call i32 @memcpy(i8* %45, i8* %31, i32 %50)
%52 = call i32 @free(i8* %31)
br label %53
53: ; preds = %49, %38, %33
%54 = phi i8* [ %35, %33 ], [ %45, %49 ], [ %31, %38 ]
%55 = phi i32 [ %30, %33 ], [ %43, %49 ], [ %30, %38 ]
%56 = trunc i32 %29 to i8
%57 = add nuw i64 %28, 1
%58 = getelementptr inbounds i8, i8* %54, i64 %28
store i8 %56, i8* %58
switch i32 %29, label %92 [
i32 45, label %59
i32 10, label %59
]
59: ; preds = %53, %53
%60 = getelementptr inbounds i8, i8* %54, i64 %57
store i8 0, i8* %60
%61 = trunc i64 %28 to i32
%62 = sub i32 %61, %16
%63 = add i32 %62, -3
%64 = icmp sgt i32 %63, -1
br i1 %64, label %65, label %71
65: ; preds = %59
%66 = zext i32 %63 to i64
%67 = getelementptr inbounds i8, i8* %54, i64 %66
%68 = call i32 @strcmp(i8* dereferenceable(1) %67, i8* %11)
%69 = icmp eq i32 %68, 0
br i1 %69, label %70, label %71
70: ; preds = %65
store i8 0, i8* %67
br label %97
71: ; preds = %65, %59
%72 = add i32 %61, %26
%73 = icmp sgt i32 %72, -1
br i1 %73, label %74, label %80
74: ; preds = %71
%75 = zext i32 %72 to i64
%76 = getelementptr inbounds i8, i8* %54, i64 %75
%77 = call i32 @strcmp(i8* dereferenceable(1) %76, i8* %9)
%78 = icmp eq i32 %77, 0
br i1 %78, label %79, label %80
79: ; preds = %74
store i8 0, i8* %76
store i32 1, i32* %2
br label %97
80: ; preds = %74, %71
%81 = icmp eq i64 %28, %24
br i1 %81, label %82, label %86
82: ; preds = %80
%83 = call i32 @strcmp(i8* dereferenceable(1) %54, i8* %10)
%84 = icmp eq i32 %83, 0
br i1 %84, label %85, label %86
85: ; preds = %82
store i8 0, i8* %54
br label %97
86: ; preds = %82, %80
%87 = icmp eq i64 %57, %25
br i1 %87, label %88, label %92
88: ; preds = %86
%89 = call i32 @strcmp(i8* dereferenceable(1) %54, i8* %8)
%90 = icmp eq i32 %89, 0
br i1 %90, label %91, label %92
91: ; preds = %88
store i8 0, i8* %54
store i32 1, i32* %2
br label %97
92: ; preds = %53, %86, %88
%93 = load i32, i32* @stdin
%94 = call i32 @fgetc(i32 %93)
%95 = load i32, i32* @EOF
%96 = icmp eq i32 %94, %95
br i1 %96, label %97, label %27
97: ; preds = %92, %91, %85, %79, %70
%98 = phi i32 [ %29, %91 ], [ %29, %85 ], [ %29, %79 ], [ %29, %70 ], [ %94, %92 ]
%99 = phi i32 [ 0, %91 ], [ 0, %85 ], [ %72, %79 ], [ %63, %70 ], [ 0, %92 ]
%100 = load i32, i32* @EOF
%101 = icmp eq i32 %98, %100
br i1 %101, label %105, label %108
102: ; preds = %3
%103 = load i32, i32* @EOF
%104 = icmp eq i32 %19, %103
br i1 %104, label %107, label %108
105: ; preds = %97
%106 = call i32 @free(i8* %54)
br label %107
107: ; preds = %102, %105
store i32 1, i32* %2
br label %111
108: ; preds = %102, %97
%109 = phi i8* [ null, %102 ], [ %54, %97 ]
%110 = phi i32 [ 0, %102 ], [ %99, %97 ]
store i32 %110, i32* %1
br label %111
111: ; preds = %47, %108, %107, %37
%112 = phi i8* [ null, %37 ], [ null, %107 ], [ %109, %108 ], [ null, %47 ]
ret i8* %112
}