#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 */
struct kore_buf {
  int dummy;
};
struct http_request {
  int dummy;
};

/* Variables and functions */
scalar_t__ isspace(char);
char *kore_buf_stringify(struct kore_buf *);
int /*<<< orphan*/ kore_mem_free(char *);
int kore_split_string(char *, char *, char **, int);
int /*<<< orphan*/ kore_strip_chars(char *, char, char **);
int /*<<< orphan*/ multipart_add_field(struct http_request *, struct kore_buf *,
                                       char *, char const *, int const);
int /*<<< orphan*/ multipart_file_add(struct http_request *, struct kore_buf *,
                                      char *, char *, char const *, int const);
scalar_t__ strcasecmp(char *, char *);
char *strchr(char *, char);
scalar_t__ strlen(char *);
int /*<<< orphan*/ strncasecmp(char *, char *, int);
int multipart_parse_headers(struct http_request *req, struct kore_buf *in,
                            struct kore_buf *hbuf, const char *boundary,
                            const int blen) {
  int h, c, i;
  char *headers[5], *args[5], *opt[5];
  char *d, *val, *name, *fname, *string;
  string = kore_buf_stringify(hbuf);
  h = kore_split_string(string, "\r\n", headers, 5);
  for (i = 0; i < h; i++) {
    c = kore_split_string(headers[i], ":", args, 5);
    if (c != 2)
      continue;
    if (strcasecmp(args[0], "content-disposition"))
      continue;
    for (d = args[1]; isspace(*d); d++)
      ;
    c = kore_split_string(d, ";", opt, 5);
    if (c < 2)
      continue;
    if (strcasecmp(opt[0], "form-data"))
      continue;
    if ((val = strchr(opt[1], '=')) == NULL)
      continue;
    if (strlen(val) < 3)
      continue;
    val++;
    kore_strip_chars(val, '"', &name);
    if (opt[2] == NULL) {
      multipart_add_field(req, in, name, boundary, blen);
      kore_mem_free(name);
      continue;
    }
    for (d = opt[2]; isspace(*d); d++)
      ;
    if (!strncasecmp(d, "filename=", 9)) {
      if ((val = strchr(d, '=')) == NULL) {
        kore_mem_free(name);
        continue;
      }
      val++;
      kore_strip_chars(val, '"', &fname);
      if (strlen(fname) > 0) {
        multipart_file_add(req, in, name, fname, boundary, blen);
      }
      kore_mem_free(fname);
    } else {
      ;
    }
    kore_mem_free(name);
  }
  return (1);
}


x86 assembly (clang, -O0):
<multipart_parse_headers>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x18(%rbp),%rdi
call   1070 <kore_buf_stringify@plt>
mov    %rax,-0xe8(%rbp)
mov    -0xe8(%rbp),%rdi
lea    -0x60(%rbp),%rdx
lea    0xe0f(%rip),%rsi
mov    $0x5,%ecx
call   1090 <kore_split_string@plt>
mov    %eax,-0x28(%rbp)
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x28(%rbp),%eax
jge    14cd <multipart_parse_headers+0x31d>
movslq -0x30(%rbp),%rax
mov    -0x60(%rbp,%rax,8),%rdi
lea    -0x90(%rbp),%rdx
lea    0xddb(%rip),%rsi
mov    $0x5,%ecx
call   1090 <kore_split_string@plt>
mov    %eax,-0x2c(%rbp)
cmpl   $0x2,-0x2c(%rbp)
je     1244 <multipart_parse_headers+0x94>
jmp    14bf <multipart_parse_headers+0x30f>
mov    -0x90(%rbp),%rdi
lea    0xdb3(%rip),%rsi
call   1040 <strcasecmp@plt>
cmp    $0x0,%rax
je     1266 <multipart_parse_headers+0xb6>
jmp    14bf <multipart_parse_headers+0x30f>
mov    -0x88(%rbp),%rax
mov    %rax,-0xc8(%rbp)
mov    -0xc8(%rbp),%rax
movsbl (%rax),%edi
call   1080 <isspace@plt>
cmp    $0x0,%rax
je     12a9 <multipart_parse_headers+0xf9>
jmp    1292 <multipart_parse_headers+0xe2>
mov    -0xc8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0xc8(%rbp)
jmp    1274 <multipart_parse_headers+0xc4>
mov    -0xc8(%rbp),%rdi
lea    -0xc0(%rbp),%rdx
lea    0xd5b(%rip),%rsi
mov    $0x5,%ecx
call   1090 <kore_split_string@plt>
mov    %eax,-0x2c(%rbp)
cmpl   $0x2,-0x2c(%rbp)
jge    12da <multipart_parse_headers+0x12a>
jmp    14bf <multipart_parse_headers+0x30f>
mov    -0xc0(%rbp),%rdi
lea    0xd33(%rip),%rsi
call   1040 <strcasecmp@plt>
cmp    $0x0,%rax
je     12fc <multipart_parse_headers+0x14c>
jmp    14bf <multipart_parse_headers+0x30f>
mov    -0xb8(%rbp),%rdi
mov    $0x3d,%esi
call   1060 <strchr@plt>
mov    %rax,-0xd0(%rbp)
cmp    $0x0,%rax
jne    1323 <multipart_parse_headers+0x173>
jmp    14bf <multipart_parse_headers+0x30f>
mov    -0xd0(%rbp),%rdi
call   1050 <strlen@plt>
cmp    $0x3,%rax
jge    133e <multipart_parse_headers+0x18e>
jmp    14bf <multipart_parse_headers+0x30f>
mov    -0xd0(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0xd0(%rbp)
mov    -0xd0(%rbp),%rdi
mov    $0x22,%esi
lea    -0xd8(%rbp),%rdx
call   10a0 <kore_strip_chars@plt>
cmpq   $0x0,-0xb0(%rbp)
jne    13a3 <multipart_parse_headers+0x1f3>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0xd8(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x24(%rbp),%r8d
call   1030 <multipart_add_field@plt>
mov    -0xd8(%rbp),%rdi
call   10c0 <kore_mem_free@plt>
jmp    14bf <multipart_parse_headers+0x30f>
mov    -0xb0(%rbp),%rax
mov    %rax,-0xc8(%rbp)
mov    -0xc8(%rbp),%rax
movsbl (%rax),%edi
call   1080 <isspace@plt>
cmp    $0x0,%rax
je     13e6 <multipart_parse_headers+0x236>
jmp    13cf <multipart_parse_headers+0x21f>
mov    -0xc8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0xc8(%rbp)
jmp    13b1 <multipart_parse_headers+0x201>
mov    -0xc8(%rbp),%rdi
lea    0xc31(%rip),%rsi
mov    $0x9,%edx
call   10b0 <strncasecmp@plt>
cmp    $0x0,%eax
jne    14ae <multipart_parse_headers+0x2fe>
mov    -0xc8(%rbp),%rdi
mov    $0x3d,%esi
call   1060 <strchr@plt>
mov    %rax,-0xd0(%rbp)
cmp    $0x0,%rax
jne    143a <multipart_parse_headers+0x28a>
mov    -0xd8(%rbp),%rdi
call   10c0 <kore_mem_free@plt>
jmp    14bf <multipart_parse_headers+0x30f>
mov    -0xd0(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0xd0(%rbp)
mov    -0xd0(%rbp),%rdi
mov    $0x22,%esi
lea    -0xe0(%rbp),%rdx
call   10a0 <kore_strip_chars@plt>
mov    -0xe0(%rbp),%rdi
call   1050 <strlen@plt>
cmp    $0x0,%rax
jle    149d <multipart_parse_headers+0x2ed>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0xd8(%rbp),%rdx
mov    -0xe0(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    -0x24(%rbp),%r9d
call   10d0 <multipart_file_add@plt>
mov    -0xe0(%rbp),%rdi
call   10c0 <kore_mem_free@plt>
jmp    14b3 <multipart_parse_headers+0x303>
jmp    14b3 <multipart_parse_headers+0x303>
mov    -0xd8(%rbp),%rdi
call   10c0 <kore_mem_free@plt>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    1205 <multipart_parse_headers+0x55>
mov    $0x1,%eax
add    $0xf0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<multipart_parse_headers>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xb8,%rsp
mov    %r8d,%r13d
mov    %rcx,0x20(%rsp)
mov    %rsi,0x18(%rsp)
mov    %rdi,0x10(%rsp)
mov    %rdx,%rdi
call   1070 <kore_buf_stringify@plt>
lea    0xe1e(%rip),%rsi
lea    0x90(%rsp),%rdx
mov    %rax,%rdi
mov    $0x5,%ecx
call   1090 <kore_split_string@plt>
test   %eax,%eax
jle    13e0 <multipart_parse_headers+0x230>
mov    %eax,%r12d
xor    %r14d,%r14d
lea    0xdf7(%rip),%r15
lea    0x60(%rsp),%rbx
jmp    124d <multipart_parse_headers+0x9d>
mov    0x8(%rsp),%rdx
mov    0x10(%rsp),%rdi
mov    0x18(%rsp),%rsi
mov    0x20(%rsp),%rcx
mov    0x4(%rsp),%r8d
call   1030 <multipart_add_field@plt>
mov    0x8(%rsp),%rdi
call   10c0 <kore_mem_free@plt>
mov    0x4(%rsp),%r13d
add    $0x1,%r14
cmp    %r12,%r14
je     13e0 <multipart_parse_headers+0x230>
mov    0x90(%rsp,%r14,8),%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
mov    $0x5,%ecx
call   1090 <kore_split_string@plt>
cmp    $0x2,%eax
jne    1240 <multipart_parse_headers+0x90>
mov    0x60(%rsp),%rdi
lea    0xd8f(%rip),%rsi
call   1040 <strcasecmp@plt>
test   %rax,%rax
jne    1240 <multipart_parse_headers+0x90>
mov    0x68(%rsp),%rbp
add    $0xffffffffffffffff,%rbp
nopl   0x0(%rax)
movsbl 0x1(%rbp),%edi
add    $0x1,%rbp
call   1080 <isspace@plt>
test   %rax,%rax
jne    1290 <multipart_parse_headers+0xe0>
mov    %rbp,%rdi
lea    0xd6d(%rip),%rsi
lea    0x30(%rsp),%rdx
mov    $0x5,%ecx
call   1090 <kore_split_string@plt>
cmp    $0x2,%eax
jl     1240 <multipart_parse_headers+0x90>
mov    0x30(%rsp),%rdi
lea    0xd4f(%rip),%rsi
call   1040 <strcasecmp@plt>
test   %rax,%rax
jne    1240 <multipart_parse_headers+0x90>
mov    0x38(%rsp),%rdi
mov    $0x3d,%esi
call   1060 <strchr@plt>
test   %rax,%rax
je     1240 <multipart_parse_headers+0x90>
mov    %rax,%rbp
mov    %rax,%rdi
call   1050 <strlen@plt>
cmp    $0x3,%rax
jl     1240 <multipart_parse_headers+0x90>
mov    %r13d,0x4(%rsp)
add    $0x1,%rbp
mov    %rbp,%rdi
mov    $0x22,%esi
lea    0x8(%rsp),%rdx
call   10a0 <kore_strip_chars@plt>
mov    0x40(%rsp),%r13
test   %r13,%r13
je     1213 <multipart_parse_headers+0x63>
add    $0xffffffffffffffff,%r13
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl 0x1(%r13),%edi
add    $0x1,%r13
call   1080 <isspace@plt>
test   %rax,%rax
jne    1340 <multipart_parse_headers+0x190>
mov    %r13,%rdi
lea    0xcc8(%rip),%rsi
mov    $0x9,%edx
call   10b0 <strncasecmp@plt>
test   %eax,%eax
jne    1231 <multipart_parse_headers+0x81>
mov    %r13,%rdi
mov    $0x3d,%esi
call   1060 <strchr@plt>
test   %rax,%rax
je     1231 <multipart_parse_headers+0x81>
add    $0x1,%rax
mov    %rax,%rdi
mov    $0x22,%esi
lea    0x28(%rsp),%rdx
call   10a0 <kore_strip_chars@plt>
mov    0x28(%rsp),%r13
mov    %r13,%rdi
call   1050 <strlen@plt>
test   %rax,%rax
jle    13d3 <multipart_parse_headers+0x223>
mov    0x8(%rsp),%rdx
mov    0x10(%rsp),%rdi
mov    0x18(%rsp),%rsi
mov    %r13,%rcx
mov    0x20(%rsp),%r8
mov    0x4(%rsp),%r9d
call   10d0 <multipart_file_add@plt>
mov    0x28(%rsp),%r13
mov    %r13,%rdi
call   10c0 <kore_mem_free@plt>
jmp    1231 <multipart_parse_headers+0x81>
mov    $0x1,%eax
add    $0xb8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.http_request = type { i32 }
%struct.kore_buf = type { i32 }
@.str = [3 x i8] c"\0D\0A\00"
@.str.1 = [2 x i8] c":\00"
@.str.2 = [20 x i8] c"content-disposition\00"
@.str.3 = [2 x i8] c";\00"
@.str.4 = [10 x i8] c"form-data\00"
@.str.5 = [10 x i8] c"filename=\00"
define i32 @multipart_parse_headers(%struct.http_request* %0, %struct.kore_buf* %1, %struct.kore_buf* %2, i8* %3, i32 %4) {
%6 = alloca %struct.http_request*
%7 = alloca %struct.kore_buf*
%8 = alloca %struct.kore_buf*
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca [5 x i8*]
%15 = alloca [5 x i8*]
%16 = alloca [5 x i8*]
%17 = alloca i8*
%18 = alloca i8*
%19 = alloca i8*
%20 = alloca i8*
%21 = alloca i8*
store %struct.http_request* %0, %struct.http_request** %6
store %struct.kore_buf* %1, %struct.kore_buf** %7
store %struct.kore_buf* %2, %struct.kore_buf** %8
store i8* %3, i8** %9
store i32 %4, i32* %10
%22 = load %struct.kore_buf*, %struct.kore_buf** %8
%23 = call i8* @kore_buf_stringify(%struct.kore_buf* %22)
store i8* %23, i8** %21
%24 = load i8*, i8** %21
%25 = getelementptr inbounds [5 x i8*], [5 x i8*]* %14, i64 0, i64 0
%26 = call i32 @kore_split_string(i8* %24, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %25, i32 5)
store i32 %26, i32* %11
store i32 0, i32* %13
br label %27
27: ; preds = %146, %5
%28 = load i32, i32* %13
%29 = load i32, i32* %11
%30 = icmp slt i32 %28, %29
br i1 %30, label %31, label %149
31: ; preds = %27
%32 = load i32, i32* %13
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds [5 x i8*], [5 x i8*]* %14, i64 0, i64 %33
%35 = load i8*, i8** %34
%36 = getelementptr inbounds [5 x i8*], [5 x i8*]* %15, i64 0, i64 0
%37 = call i32 @kore_split_string(i8* %35, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8** %36, i32 5)
store i32 %37, i32* %12
%38 = load i32, i32* %12
%39 = icmp ne i32 %38, 2
br i1 %39, label %40, label %41
40: ; preds = %31
br label %146
41: ; preds = %31
%42 = getelementptr inbounds [5 x i8*], [5 x i8*]* %15, i64 0, i64 0
%43 = load i8*, i8** %42
%44 = call i64 @strcasecmp(i8* %43, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
%45 = icmp ne i64 %44, 0
br i1 %45, label %46, label %47
46: ; preds = %41
br label %146
47: ; preds = %41
%48 = getelementptr inbounds [5 x i8*], [5 x i8*]* %15, i64 0, i64 1
%49 = load i8*, i8** %48
store i8* %49, i8** %17
br label %50
50: ; preds = %56, %47
%51 = load i8*, i8** %17
%52 = load i8, i8* %51
%53 = call i64 @isspace(i8 signext %52)
%54 = icmp ne i64 %53, 0
br i1 %54, label %55, label %59
55: ; preds = %50
br label %56
56: ; preds = %55
%57 = load i8*, i8** %17
%58 = getelementptr inbounds i8, i8* %57, i32 1
store i8* %58, i8** %17
br label %50
59: ; preds = %50
%60 = load i8*, i8** %17
%61 = getelementptr inbounds [5 x i8*], [5 x i8*]* %16, i64 0, i64 0
%62 = call i32 @kore_split_string(i8* %60, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i8** %61, i32 5)
store i32 %62, i32* %12
%63 = load i32, i32* %12
%64 = icmp slt i32 %63, 2
br i1 %64, label %65, label %66
65: ; preds = %59
br label %146
66: ; preds = %59
%67 = getelementptr inbounds [5 x i8*], [5 x i8*]* %16, i64 0, i64 0
%68 = load i8*, i8** %67
%69 = call i64 @strcasecmp(i8* %68, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0))
%70 = icmp ne i64 %69, 0
br i1 %70, label %71, label %72
71: ; preds = %66
br label %146
72: ; preds = %66
%73 = getelementptr inbounds [5 x i8*], [5 x i8*]* %16, i64 0, i64 1
%74 = load i8*, i8** %73
%75 = call i8* @strchr(i8* %74, i8 signext 61)
store i8* %75, i8** %18
%76 = icmp eq i8* %75, null
br i1 %76, label %77, label %78
77: ; preds = %72
br label %146
78: ; preds = %72
%79 = load i8*, i8** %18
%80 = call i64 @strlen(i8* %79)
%81 = icmp slt i64 %80, 3
br i1 %81, label %82, label %83
82: ; preds = %78
br label %146
83: ; preds = %78
%84 = load i8*, i8** %18
%85 = getelementptr inbounds i8, i8* %84, i32 1
store i8* %85, i8** %18
%86 = load i8*, i8** %18
%87 = call i32 @kore_strip_chars(i8* %86, i8 signext 34, i8** %19)
%88 = getelementptr inbounds [5 x i8*], [5 x i8*]* %16, i64 0, i64 2
%89 = load i8*, i8** %88
%90 = icmp eq i8* %89, null
br i1 %90, label %91, label %100
91: ; preds = %83
%92 = load %struct.http_request*, %struct.http_request** %6
%93 = load %struct.kore_buf*, %struct.kore_buf** %7
%94 = load i8*, i8** %19
%95 = load i8*, i8** %9
%96 = load i32, i32* %10
%97 = call i32 @multipart_add_field(%struct.http_request* %92, %struct.kore_buf* %93, i8* %94, i8* %95, i32 %96)
%98 = load i8*, i8** %19
%99 = call i32 @kore_mem_free(i8* %98)
br label %146
100: ; preds = %83
%101 = getelementptr inbounds [5 x i8*], [5 x i8*]* %16, i64 0, i64 2
%102 = load i8*, i8** %101
store i8* %102, i8** %17
br label %103
103: ; preds = %109, %100
%104 = load i8*, i8** %17
%105 = load i8, i8* %104
%106 = call i64 @isspace(i8 signext %105)
%107 = icmp ne i64 %106, 0
br i1 %107, label %108, label %112
108: ; preds = %103
br label %109
109: ; preds = %108
%110 = load i8*, i8** %17
%111 = getelementptr inbounds i8, i8* %110, i32 1
store i8* %111, i8** %17
br label %103
112: ; preds = %103
%113 = load i8*, i8** %17
%114 = call i32 @strncasecmp(i8* %113, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0), i32 9)
%115 = icmp ne i32 %114, 0
br i1 %115, label %142, label %116
116: ; preds = %112
%117 = load i8*, i8** %17
%118 = call i8* @strchr(i8* %117, i8 signext 61)
store i8* %118, i8** %18
%119 = icmp eq i8* %118, null
br i1 %119, label %120, label %123
120: ; preds = %116
%121 = load i8*, i8** %19
%122 = call i32 @kore_mem_free(i8* %121)
br label %146
123: ; preds = %116
%124 = load i8*, i8** %18
%125 = getelementptr inbounds i8, i8* %124, i32 1
store i8* %125, i8** %18
%126 = load i8*, i8** %18
%127 = call i32 @kore_strip_chars(i8* %126, i8 signext 34, i8** %20)
%128 = load i8*, i8** %20
%129 = call i64 @strlen(i8* %128)
%130 = icmp sgt i64 %129, 0
br i1 %130, label %131, label %139
131: ; preds = %123
%132 = load %struct.http_request*, %struct.http_request** %6
%133 = load %struct.kore_buf*, %struct.kore_buf** %7
%134 = load i8*, i8** %19
%135 = load i8*, i8** %20
%136 = load i8*, i8** %9
%137 = load i32, i32* %10
%138 = call i32 @multipart_file_add(%struct.http_request* %132, %struct.kore_buf* %133, i8* %134, i8* %135, i8* %136, i32 %137)
br label %139
139: ; preds = %131, %123
%140 = load i8*, i8** %20
%141 = call i32 @kore_mem_free(i8* %140)
br label %143
142: ; preds = %112
br label %143
143: ; preds = %142, %139
%144 = load i8*, i8** %19
%145 = call i32 @kore_mem_free(i8* %144)
br label %146
146: ; preds = %143, %120, %91, %82, %77, %71, %65, %46, %40
%147 = load i32, i32* %13
%148 = add nsw i32 %147, 1
store i32 %148, i32* %13
br label %27
149: ; preds = %27
ret i32 1
}

LLVM IR (-O2):
%struct.http_request = type { i32 }
%struct.kore_buf = type { i32 }
@.str = [3 x i8] c"\0D\0A\00"
@.str.1 = [2 x i8] c":\00"
@.str.2 = [20 x i8] c"content-disposition\00"
@.str.3 = [2 x i8] c";\00"
@.str.4 = [10 x i8] c"form-data\00"
@.str.5 = [10 x i8] c"filename=\00"
define i32 @multipart_parse_headers(%struct.http_request* %0, %struct.kore_buf* %1, %struct.kore_buf* %2, i8* %3, i32 %4) {
%6 = alloca [5 x i8*]
%7 = alloca [5 x i8*]
%8 = alloca [5 x i8*]
%9 = alloca i8*
%10 = alloca i8*
%11 = bitcast [5 x i8*]* %6 to i8*
%12 = bitcast [5 x i8*]* %7 to i8*
%13 = bitcast [5 x i8*]* %8 to i8*
%14 = bitcast i8** %9 to i8*
%15 = bitcast i8** %10 to i8*
%16 = tail call i8* @kore_buf_stringify(%struct.kore_buf* %2)
%17 = getelementptr inbounds [5 x i8*], [5 x i8*]* %6, i64 0, i64 0
%18 = call i32 @kore_split_string(i8* %16, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %17, i32 5)
%19 = icmp sgt i32 %18, 0
br i1 %19, label %20, label %98
20: ; preds = %5
%21 = getelementptr inbounds [5 x i8*], [5 x i8*]* %7, i64 0, i64 0
%22 = getelementptr inbounds [5 x i8*], [5 x i8*]* %7, i64 0, i64 1
%23 = getelementptr inbounds [5 x i8*], [5 x i8*]* %8, i64 0, i64 0
%24 = getelementptr inbounds [5 x i8*], [5 x i8*]* %8, i64 0, i64 1
%25 = getelementptr inbounds [5 x i8*], [5 x i8*]* %8, i64 0, i64 2
%26 = zext i32 %18 to i64
br label %27
27: ; preds = %20, %95
%28 = phi i64 [ 0, %20 ], [ %96, %95 ]
%29 = getelementptr inbounds [5 x i8*], [5 x i8*]* %6, i64 0, i64 %28
%30 = load i8*, i8** %29
%31 = call i32 @kore_split_string(i8* %30, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8** %21, i32 5)
%32 = icmp eq i32 %31, 2
br i1 %32, label %33, label %95
33: ; preds = %27
%34 = load i8*, i8** %21
%35 = call i64 @strcasecmp(i8* %34, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
%36 = icmp eq i64 %35, 0
br i1 %36, label %37, label %95
37: ; preds = %33
%38 = load i8*, i8** %22
br label %39
39: ; preds = %39, %37
%40 = phi i8* [ %38, %37 ], [ %44, %39 ]
%41 = load i8, i8* %40
%42 = call i64 @isspace(i8 signext %41)
%43 = icmp eq i64 %42, 0
%44 = getelementptr inbounds i8, i8* %40, i64 1
br i1 %43, label %45, label %39
45: ; preds = %39
%46 = call i32 @kore_split_string(i8* %40, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i8** %23, i32 5)
%47 = icmp slt i32 %46, 2
br i1 %47, label %95, label %48
48: ; preds = %45
%49 = load i8*, i8** %23
%50 = call i64 @strcasecmp(i8* %49, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0))
%51 = icmp eq i64 %50, 0
br i1 %51, label %52, label %95
52: ; preds = %48
%53 = load i8*, i8** %24
%54 = call i8* @strchr(i8* dereferenceable(1) %53, i8 signext 61)
%55 = icmp eq i8* %54, null
br i1 %55, label %95, label %56
56: ; preds = %52
%57 = call i64 @strlen(i8* %54)
%58 = icmp slt i64 %57, 3
br i1 %58, label %95, label %59
59: ; preds = %56
%60 = getelementptr inbounds i8, i8* %54, i64 1
%61 = call i32 @kore_strip_chars(i8* %60, i8 signext 34, i8** %9)
%62 = load i8*, i8** %25
%63 = icmp eq i8* %62, null
br i1 %63, label %64, label %67
64: ; preds = %59
%65 = load i8*, i8** %9
%66 = call i32 @multipart_add_field(%struct.http_request* %0, %struct.kore_buf* %1, i8* %65, i8* %3, i32 %4)
br label %92
67: ; preds = %59, %67
%68 = phi i8* [ %72, %67 ], [ %62, %59 ]
%69 = load i8, i8* %68
%70 = call i64 @isspace(i8 signext %69)
%71 = icmp eq i64 %70, 0
%72 = getelementptr inbounds i8, i8* %68, i64 1
br i1 %71, label %73, label %67
73: ; preds = %67
%74 = call i32 @strncasecmp(i8* %68, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0), i32 9)
%75 = icmp eq i32 %74, 0
br i1 %75, label %76, label %92
76: ; preds = %73
%77 = call i8* @strchr(i8* %68, i8 signext 61)
%78 = icmp eq i8* %77, null
br i1 %78, label %92, label %79
79: ; preds = %76
%80 = getelementptr inbounds i8, i8* %77, i64 1
%81 = call i32 @kore_strip_chars(i8* %80, i8 signext 34, i8** %10)
%82 = load i8*, i8** %10
%83 = call i64 @strlen(i8* dereferenceable(1) %82)
%84 = icmp sgt i64 %83, 0
br i1 %84, label %85, label %89
85: ; preds = %79
%86 = load i8*, i8** %9
%87 = call i32 @multipart_file_add(%struct.http_request* %0, %struct.kore_buf* %1, i8* %86, i8* %82, i8* %3, i32 %4)
%88 = load i8*, i8** %10
br label %89
89: ; preds = %85, %79
%90 = phi i8* [ %88, %85 ], [ %82, %79 ]
%91 = call i32 @kore_mem_free(i8* %90)
br label %92
92: ; preds = %89, %73, %76, %64
%93 = load i8*, i8** %9
%94 = call i32 @kore_mem_free(i8* %93)
br label %95
95: ; preds = %92, %56, %52, %48, %45, %33, %27
%96 = add nuw nsw i64 %28, 1
%97 = icmp eq i64 %96, %26
br i1 %97, label %98, label %27
98: ; preds = %95, %5
ret i32 1
}