#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 */
char *column(char *, int, char *);
char *piece(char *, char, char *, int);
char piece_delimiter_search(char *);
char *piece_quoted(char *, char, char *, int, char);
char *piece_unknown(char *destination, char *delimiter, char *source,
                    int offset) {
  if (!*delimiter) {
    *delimiter = piece_delimiter_search(source);
  }
  if (*delimiter == 1) {
    return piece_quoted(destination, ',', source, offset, '"');
  } else if (*delimiter == 2 || *delimiter == 9 || *delimiter == 't') {
    return column(destination, offset, source);
  } else {
    return piece(destination, *delimiter, source, offset);
  }
}


x86 assembly (clang, -O0):
<piece_unknown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1175 <piece_unknown+0x35>
mov    -0x20(%rbp),%rdi
call   1050 <piece_delimiter_search@plt>
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x1,%eax
jne    11a9 <piece_unknown+0x69>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rdx
mov    -0x24(%rbp),%ecx
mov    $0x2c,%esi
mov    $0x22,%r8d
call   1030 <piece_quoted@plt>
mov    %rax,-0x8(%rbp)
jmp    120f <piece_unknown+0xcf>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2,%eax
je     11d9 <piece_unknown+0x99>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
je     11d9 <piece_unknown+0x99>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x74,%eax
jne    11f2 <piece_unknown+0xb2>
mov    -0x10(%rbp),%rdi
mov    -0x24(%rbp),%esi
mov    -0x20(%rbp),%rdx
call   1040 <column@plt>
mov    %rax,-0x8(%rbp)
jmp    120f <piece_unknown+0xcf>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    (%rax),%al
mov    -0x20(%rbp),%rdx
mov    -0x24(%rbp),%ecx
movsbl %al,%esi
call   1060 <piece@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<piece_unknown>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %rdx,%rbx
mov    %rdi,%r15
mov    (%rsi),%al
test   %al,%al
je     1164 <piece_unknown+0x24>
cmp    $0x8,%al
jg     1176 <piece_unknown+0x36>
cmp    $0x1,%al
je     11b1 <piece_unknown+0x71>
cmp    $0x2,%al
je     117e <piece_unknown+0x3e>
jmp    1196 <piece_unknown+0x56>
mov    %rsi,%rbp
mov    %rbx,%rdi
call   1050 <piece_delimiter_search@plt>
mov    %al,0x0(%rbp)
cmp    $0x8,%al
jle    115a <piece_unknown+0x1a>
cmp    $0x9,%al
je     117e <piece_unknown+0x3e>
cmp    $0x74,%al
jne    1196 <piece_unknown+0x56>
mov    %r15,%rdi
mov    %r14d,%esi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <column@plt>
movsbl %al,%esi
mov    %r15,%rdi
mov    %rbx,%rdx
mov    %r14d,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1060 <piece@plt>
mov    %r15,%rdi
mov    $0x2c,%esi
mov    %rbx,%rdx
mov    %r14d,%ecx
mov    $0x22,%r8d
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <piece_quoted@plt>

LLVM IR (-O0):
define i8* @piece_unknown(i8* %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32
store i8* %0, i8** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i32 %3, i32* %9
%10 = load i8*, i8** %7
%11 = load i8, i8* %10
%12 = icmp ne i8 %11, 0
br i1 %12, label %17, label %13
13: ; preds = %4
%14 = load i8*, i8** %8
%15 = call signext i8 @piece_delimiter_search(i8* %14)
%16 = load i8*, i8** %7
store i8 %15, i8* %16
br label %17
17: ; preds = %13, %4
%18 = load i8*, i8** %7
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, 1
br i1 %21, label %22, label %27
22: ; preds = %17
%23 = load i8*, i8** %6
%24 = load i8*, i8** %8
%25 = load i32, i32* %9
%26 = call i8* @piece_quoted(i8* %23, i8 signext 44, i8* %24, i32 %25, i8 signext 34)
store i8* %26, i8** %5
br label %54
27: ; preds = %17
%28 = load i8*, i8** %7
%29 = load i8, i8* %28
%30 = sext i8 %29 to i32
%31 = icmp eq i32 %30, 2
br i1 %31, label %42, label %32
32: ; preds = %27
%33 = load i8*, i8** %7
%34 = load i8, i8* %33
%35 = sext i8 %34 to i32
%36 = icmp eq i32 %35, 9
br i1 %36, label %42, label %37
37: ; preds = %32
%38 = load i8*, i8** %7
%39 = load i8, i8* %38
%40 = sext i8 %39 to i32
%41 = icmp eq i32 %40, 116
br i1 %41, label %42, label %47
42: ; preds = %37, %32, %27
%43 = load i8*, i8** %6
%44 = load i32, i32* %9
%45 = load i8*, i8** %8
%46 = call i8* @column(i8* %43, i32 %44, i8* %45)
store i8* %46, i8** %5
br label %54
47: ; preds = %37
%48 = load i8*, i8** %6
%49 = load i8*, i8** %7
%50 = load i8, i8* %49
%51 = load i8*, i8** %8
%52 = load i32, i32* %9
%53 = call i8* @piece(i8* %48, i8 signext %50, i8* %51, i32 %52)
store i8* %53, i8** %5
br label %54
54: ; preds = %47, %42, %22
%55 = load i8*, i8** %5
ret i8* %55
}

LLVM IR (-O2):
define i8* @piece_unknown(i8* %0, i8* nocapture %1, i8* %2, i32 %3) {
%5 = load i8, i8* %1
%6 = icmp eq i8 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = tail call signext i8 @piece_delimiter_search(i8* %2)
store i8 %8, i8* %1
br label %9
9: ; preds = %7, %4
%10 = phi i8 [ %8, %7 ], [ %5, %4 ]
switch i8 %10, label %15 [
i8 1, label %11
i8 2, label %13
i8 9, label %13
i8 116, label %13
]
11: ; preds = %9
%12 = tail call i8* @piece_quoted(i8* %0, i8 signext 44, i8* %2, i32 %3, i8 signext 34)
br label %17
13: ; preds = %9, %9, %9
%14 = tail call i8* @column(i8* %0, i32 %3, i8* %2)
br label %17
15: ; preds = %9
%16 = tail call i8* @piece(i8* %0, i8 signext %10, i8* %2, i32 %3)
br label %17
17: ; preds = %15, %13, %11
%18 = phi i8* [ %12, %11 ], [ %14, %13 ], [ %16, %15 ]
ret i8* %18
}