#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 wchar_t;

/* Variables and functions */
int /*<<< orphan*/ wcslen(int *);
int *wcspbrk(int *, char *);
scalar_t__ wcsspn(int *, char *);
int /*<<< orphan*/ wmemmove(int *, int *, int /*<<< orphan*/);
wchar_t *strdelim(wchar_t **s) {
  wchar_t *old;
  int wspace = 0;
  if (*s == NULL)
    return (NULL);
  old = *s;
  *s = wcspbrk(*s, L" \t\r\n"
                   L"\""
                   "=");
  if (*s == NULL)
    return (old);
  if (*s[0] == L'\"') {
    wmemmove(*s, *s + 1, wcslen(*s));
    if ((*s = wcspbrk(*s, L"\"")) == NULL) {
      return (NULL);
    } else {
      *s[0] = L'\0';
      return (old);
    }
  }
  if (*s[0] == L'=')
    wspace = 1;
  *s[0] = L'\0';
  *s += wcsspn(*s + 1, L" \t\r\n") + 1;
  if (*s[0] == L'=' && !wspace)
    *s += wcsspn(*s + 1, L" \t\r\n") + 1;
  return (old);
}


x86 assembly (clang, -O0):
<strdelim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
jne    116e <strdelim+0x2e>
movq   $0x0,-0x8(%rbp)
jmp    12df <strdelim+0x19f>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xe79(%rip),%rsi
call   1040 <wcspbrk@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
jne    11b1 <strdelim+0x71>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    12df <strdelim+0x19f>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
cmpl   $0x22,(%rax)
jne    1241 <strdelim+0x101>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
add    $0x4,%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <wcslen@plt>
mov    -0x30(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    %eax,%edx
call   1060 <wmemmove@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xe18(%rip),%rsi
call   1040 <wcspbrk@plt>
mov    -0x10(%rbp),%rcx
mov    %rax,(%rcx)
cmp    $0x0,%rax
jne    1227 <strdelim+0xe7>
movq   $0x0,-0x8(%rbp)
jmp    12df <strdelim+0x19f>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movl   $0x0,(%rax)
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    12df <strdelim+0x19f>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
cmpl   $0x3d,(%rax)
jne    1258 <strdelim+0x118>
movl   $0x1,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movl   $0x0,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
add    $0x4,%rdi
lea    0xdad(%rip),%rsi
call   1050 <wcsspn@plt>
mov    %rax,%rcx
add    $0x1,%rcx
mov    -0x10(%rbp),%rax
shl    $0x2,%rcx
add    (%rax),%rcx
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
cmpl   $0x3d,(%rax)
jne    12d7 <strdelim+0x197>
cmpl   $0x0,-0x1c(%rbp)
jne    12d7 <strdelim+0x197>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
add    $0x4,%rdi
lea    0xd67(%rip),%rsi
call   1050 <wcsspn@plt>
mov    %rax,%rcx
add    $0x1,%rcx
mov    -0x10(%rbp),%rax
shl    $0x2,%rcx
add    (%rax),%rcx
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdelim>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    (%rdi),%r14
test   %r14,%r14
je     11af <strdelim+0x6f>
mov    %rdi,%r15
lea    0xea6(%rip),%rsi
mov    %r14,%rdi
call   1040 <wcspbrk@plt>
mov    %rax,(%r15)
test   %rax,%rax
je     11b2 <strdelim+0x72>
mov    %rax,%rbx
mov    (%rax),%ebp
cmp    $0x22,%ebp
jne    11be <strdelim+0x7e>
mov    %rbx,%r12
add    $0x4,%r12
mov    %rbx,%rdi
call   1030 <wcslen@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
mov    %eax,%edx
call   1060 <wmemmove@plt>
mov    (%r15),%rdi
lea    0xe82(%rip),%rsi
call   1040 <wcspbrk@plt>
mov    %rax,(%r15)
test   %rax,%rax
je     11af <strdelim+0x6f>
movl   $0x0,(%rax)
jmp    11b2 <strdelim+0x72>
xor    %r14d,%r14d
mov    %r14,%rax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
movl   $0x0,(%rbx)
add    $0x4,%rbx
lea    0xe55(%rip),%rsi
mov    %rbx,%rdi
call   1050 <wcsspn@plt>
mov    (%r15),%rcx
lea    (%rcx,%rax,4),%rdi
add    $0x4,%rdi
mov    %rdi,(%r15)
cmpl   $0x3d,0x4(%rcx,%rax,4)
jne    11b2 <strdelim+0x72>
cmp    $0x3d,%ebp
je     11b2 <strdelim+0x72>
add    $0x4,%rdi
lea    0xe28(%rip),%rsi
call   1050 <wcsspn@plt>
mov    (%r15),%rcx
lea    (%rcx,%rax,4),%rax
add    $0x4,%rax
mov    %rax,(%r15)
jmp    11b2 <strdelim+0x72>

LLVM IR (-O0):
@.str = [7 x i32] [i32 32, i32 9, i32 13, i32 10, i32 34, i32 61, i32 0]
@.str.1 = [2 x i32] [i32 34, i32 0]
@.str.2 = [5 x i32] [i32 32, i32 9, i32 13, i32 10, i32 0]
define i32* @strdelim(i32** %0) {
%2 = alloca i32*
%3 = alloca i32**
%4 = alloca i32*
%5 = alloca i32
store i32** %0, i32*** %3
store i32 0, i32* %5
%6 = load i32**, i32*** %3
%7 = load i32*, i32** %6
%8 = icmp eq i32* %7, null
br i1 %8, label %9, label %10
9: ; preds = %1
store i32* null, i32** %2
br label %87
10: ; preds = %1
%11 = load i32**, i32*** %3
%12 = load i32*, i32** %11
store i32* %12, i32** %4
%13 = load i32**, i32*** %3
%14 = load i32*, i32** %13
%15 = call i32* @wcspbrk(i32* %14, i8* bitcast ([7 x i32]* @.str to i8*))
%16 = load i32**, i32*** %3
store i32* %15, i32** %16
%17 = load i32**, i32*** %3
%18 = load i32*, i32** %17
%19 = icmp eq i32* %18, null
br i1 %19, label %20, label %22
20: ; preds = %10
%21 = load i32*, i32** %4
store i32* %21, i32** %2
br label %87
22: ; preds = %10
%23 = load i32**, i32*** %3
%24 = getelementptr inbounds i32*, i32** %23, i64 0
%25 = load i32*, i32** %24
%26 = load i32, i32* %25
%27 = icmp eq i32 %26, 34
br i1 %27, label %28, label %49
28: ; preds = %22
%29 = load i32**, i32*** %3
%30 = load i32*, i32** %29
%31 = load i32**, i32*** %3
%32 = load i32*, i32** %31
%33 = getelementptr inbounds i32, i32* %32, i64 1
%34 = load i32**, i32*** %3
%35 = load i32*, i32** %34
%36 = call i32 @wcslen(i32* %35)
%37 = call i32 @wmemmove(i32* %30, i32* %33, i32 %36)
%38 = load i32**, i32*** %3
%39 = load i32*, i32** %38
%40 = call i32* @wcspbrk(i32* %39, i8* bitcast ([2 x i32]* @.str.1 to i8*))
%41 = load i32**, i32*** %3
store i32* %40, i32** %41
%42 = icmp eq i32* %40, null
br i1 %42, label %43, label %44
43: ; preds = %28
store i32* null, i32** %2
br label %87
44: ; preds = %28
%45 = load i32**, i32*** %3
%46 = getelementptr inbounds i32*, i32** %45, i64 0
%47 = load i32*, i32** %46
store i32 0, i32* %47
%48 = load i32*, i32** %4
store i32* %48, i32** %2
br label %87
49: ; preds = %22
%50 = load i32**, i32*** %3
%51 = getelementptr inbounds i32*, i32** %50, i64 0
%52 = load i32*, i32** %51
%53 = load i32, i32* %52
%54 = icmp eq i32 %53, 61
br i1 %54, label %55, label %56
55: ; preds = %49
store i32 1, i32* %5
br label %56
56: ; preds = %55, %49
%57 = load i32**, i32*** %3
%58 = getelementptr inbounds i32*, i32** %57, i64 0
%59 = load i32*, i32** %58
store i32 0, i32* %59
%60 = load i32**, i32*** %3
%61 = load i32*, i32** %60
%62 = getelementptr inbounds i32, i32* %61, i64 1
%63 = call i64 @wcsspn(i32* %62, i8* bitcast ([5 x i32]* @.str.2 to i8*))
%64 = add nsw i64 %63, 1
%65 = load i32**, i32*** %3
%66 = load i32*, i32** %65
%67 = getelementptr inbounds i32, i32* %66, i64 %64
store i32* %67, i32** %65
%68 = load i32**, i32*** %3
%69 = getelementptr inbounds i32*, i32** %68, i64 0
%70 = load i32*, i32** %69
%71 = load i32, i32* %70
%72 = icmp eq i32 %71, 61
br i1 %72, label %73, label %85
73: ; preds = %56
%74 = load i32, i32* %5
%75 = icmp ne i32 %74, 0
br i1 %75, label %85, label %76
76: ; preds = %73
%77 = load i32**, i32*** %3
%78 = load i32*, i32** %77
%79 = getelementptr inbounds i32, i32* %78, i64 1
%80 = call i64 @wcsspn(i32* %79, i8* bitcast ([5 x i32]* @.str.2 to i8*))
%81 = add nsw i64 %80, 1
%82 = load i32**, i32*** %3
%83 = load i32*, i32** %82
%84 = getelementptr inbounds i32, i32* %83, i64 %81
store i32* %84, i32** %82
br label %85
85: ; preds = %76, %73, %56
%86 = load i32*, i32** %4
store i32* %86, i32** %2
br label %87
87: ; preds = %85, %44, %43, %20, %9
%88 = load i32*, i32** %2
ret i32* %88
}

LLVM IR (-O2):
@.str = [7 x i32] [i32 32, i32 9, i32 13, i32 10, i32 34, i32 61, i32 0]
@.str.1 = [2 x i32] [i32 34, i32 0]
@.str.2 = [5 x i32] [i32 32, i32 9, i32 13, i32 10, i32 0]
define i32* @strdelim(i32** nocapture %0) {
%2 = load i32*, i32** %0
%3 = icmp eq i32* %2, null
br i1 %3, label %34, label %4
4: ; preds = %1
%5 = tail call i32* @wcspbrk(i32* %2, i8* bitcast ([7 x i32]* @.str to i8*))
store i32* %5, i32** %0
%6 = icmp eq i32* %5, null
br i1 %6, label %34, label %7
7: ; preds = %4
%8 = load i32, i32* %5
%9 = icmp eq i32 %8, 34
br i1 %9, label %10, label %18
10: ; preds = %7
%11 = getelementptr inbounds i32, i32* %5, i64 1
%12 = tail call i32 @wcslen(i32* %5)
%13 = tail call i32 @wmemmove(i32* %5, i32* %11, i32 %12)
%14 = load i32*, i32** %0
%15 = tail call i32* @wcspbrk(i32* %14, i8* bitcast ([2 x i32]* @.str.1 to i8*))
store i32* %15, i32** %0
%16 = icmp eq i32* %15, null
br i1 %16, label %34, label %17
17: ; preds = %10
store i32 0, i32* %15
br label %34
18: ; preds = %7
%19 = icmp eq i32 %8, 61
store i32 0, i32* %5
%20 = getelementptr inbounds i32, i32* %5, i64 1
%21 = tail call i64 @wcsspn(i32* %20, i8* bitcast ([5 x i32]* @.str.2 to i8*))
%22 = add nsw i64 %21, 1
%23 = load i32*, i32** %0
%24 = getelementptr inbounds i32, i32* %23, i64 %22
store i32* %24, i32** %0
%25 = load i32, i32* %24
%26 = icmp ne i32 %25, 61
%27 = select i1 %26, i1 true, i1 %19
br i1 %27, label %34, label %28
28: ; preds = %18
%29 = getelementptr inbounds i32, i32* %24, i64 1
%30 = tail call i64 @wcsspn(i32* %29, i8* bitcast ([5 x i32]* @.str.2 to i8*))
%31 = add nsw i64 %30, 1
%32 = load i32*, i32** %0
%33 = getelementptr inbounds i32, i32* %32, i64 %31
store i32* %33, i32** %0
br label %34
34: ; preds = %18, %28, %10, %4, %1, %17
%35 = phi i32* [ %2, %17 ], [ null, %1 ], [ %2, %4 ], [ null, %10 ], [ %2, %28 ], [ %2, %18 ]
ret i32* %35
}