#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 *strchr(char *, char);
void move_delim(char **buf, char **delim) {
  while (**buf == ' ' || **buf == '\t') {
    ++*buf;
  }
  switch (**buf) {
  case '\'':
  case '\"':
    ++*buf;
    *delim = strchr(*buf, (*buf)[-1]);
    break;
  default:
    *delim = strchr(*buf, ' ');
    break;
  }
}


x86 assembly (clang, -O0):
<move_delim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x11(%rbp)
je     114b <move_delim+0x3b>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    115b <move_delim+0x4b>
jmp    116e <move_delim+0x5e>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    1120 <move_delim+0x10>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
mov    %eax,-0x18(%rbp)
sub    $0x22,%eax
je     119a <move_delim+0x8a>
jmp    1189 <move_delim+0x79>
mov    -0x18(%rbp),%eax
sub    $0x27,%eax
jne    11ce <move_delim+0xbe>
jmp    119a <move_delim+0x8a>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl -0x1(%rax),%esi
call   1030 <strchr@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
jmp    11e9 <move_delim+0xd9>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    $0x20,%esi
call   1030 <strchr@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<move_delim>:
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%rax
mov    (%rdi),%rdi
jmp    1127 <move_delim+0x17>
nopl   0x0(%rax)
add    $0x1,%rdi
mov    %rdi,(%rax)
movsbl (%rdi),%ecx
cmp    $0x20,%ecx
je     1120 <move_delim+0x10>
cmp    $0x9,%cl
je     1120 <move_delim+0x10>
cmp    $0x27,%ecx
je     113e <move_delim+0x2e>
cmp    $0x22,%ecx
jne    114d <move_delim+0x3d>
lea    0x1(%rdi),%rcx
mov    %rcx,(%rax)
movsbl (%rdi),%esi
mov    %rcx,%rdi
jmp    1152 <move_delim+0x42>
mov    $0x20,%esi
call   1030 <strchr@plt>
mov    %rax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @move_delim(i8** %0, i8** %1) {
%3 = alloca i8**
%4 = alloca i8**
store i8** %0, i8*** %3
store i8** %1, i8*** %4
br label %5
5: ; preds = %19, %2
%6 = load i8**, i8*** %3
%7 = load i8*, i8** %6
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 32
br i1 %10, label %17, label %11
11: ; preds = %5
%12 = load i8**, i8*** %3
%13 = load i8*, i8** %12
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %15, 9
br label %17
17: ; preds = %11, %5
%18 = phi i1 [ true, %5 ], [ %16, %11 ]
br i1 %18, label %19, label %23
19: ; preds = %17
%20 = load i8**, i8*** %3
%21 = load i8*, i8** %20
%22 = getelementptr inbounds i8, i8* %21, i32 1
store i8* %22, i8** %20
br label %5
23: ; preds = %17
%24 = load i8**, i8*** %3
%25 = load i8*, i8** %24
%26 = load i8, i8* %25
%27 = sext i8 %26 to i32
switch i32 %27, label %40 [
i32 39, label %28
i32 34, label %28
]
28: ; preds = %23, %23
%29 = load i8**, i8*** %3
%30 = load i8*, i8** %29
%31 = getelementptr inbounds i8, i8* %30, i32 1
store i8* %31, i8** %29
%32 = load i8**, i8*** %3
%33 = load i8*, i8** %32
%34 = load i8**, i8*** %3
%35 = load i8*, i8** %34
%36 = getelementptr inbounds i8, i8* %35, i64 -1
%37 = load i8, i8* %36
%38 = call i8* @strchr(i8* %33, i8 signext %37)
%39 = load i8**, i8*** %4
store i8* %38, i8** %39
br label %45
40: ; preds = %23
%41 = load i8**, i8*** %3
%42 = load i8*, i8** %41
%43 = call i8* @strchr(i8* %42, i8 signext 32)
%44 = load i8**, i8*** %4
store i8* %43, i8** %44
br label %45
45: ; preds = %40, %28
ret void
}

LLVM IR (-O2):
define void @move_delim(i8** nocapture %0, i8** nocapture writeonly %1) {
%3 = load i8*, i8** %0
br label %4
4: ; preds = %7, %2
%5 = phi i8* [ %8, %7 ], [ %3, %2 ]
%6 = load i8, i8* %5
switch i8 %6, label %9 [
i8 32, label %7
i8 9, label %7
]
7: ; preds = %4, %4
%8 = getelementptr inbounds i8, i8* %5, i64 1
store i8* %8, i8** %0
br label %4
9: ; preds = %4
%10 = sext i8 %6 to i32
switch i32 %10, label %15 [
i32 39, label %11
i32 34, label %11
]
11: ; preds = %9, %9
%12 = getelementptr inbounds i8, i8* %5, i64 1
store i8* %12, i8** %0
%13 = load i8, i8* %5
%14 = tail call i8* @strchr(i8* %12, i8 signext %13)
br label %17
15: ; preds = %9
%16 = tail call i8* @strchr(i8* %5, i8 signext 32)
br label %17
17: ; preds = %15, %11
%18 = phi i8* [ %14, %11 ], [ %16, %15 ]
store i8* %18, i8** %1
ret void
}