#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 */
int /*<<< orphan*/ isspace(unsigned char);
char *scanp(char *);
char *seekp(char *p, char *c, char **a) {
  char *cp;
  p = cp = scanp(p);
  while (!isspace((unsigned char)*cp) && *cp && *cp != ':' && *cp != ';')
    cp++;
  *c = *cp;
  *cp++ = 0;
  *a = cp;
  return p;
}


x86 assembly (clang, -O0):
<seekp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <scanp@plt>
mov    %rax,-0x20(%rbp)
mov    %rax,-0x8(%rbp)
mov    -0x20(%rbp),%rax
movzbl (%rax),%edi
call   1030 <isspace@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x21(%rbp)
jne    119b <seekp+0x7b>
mov    -0x20(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x21(%rbp)
je     119b <seekp+0x7b>
mov    -0x20(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x3a,%ecx
mov    %al,-0x21(%rbp)
je     119b <seekp+0x7b>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3b,%eax
setne  %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
test   $0x1,%al
jne    11ab <seekp+0x8b>
jmp    11bc <seekp+0x9c>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1145 <seekp+0x25>
mov    -0x20(%rbp),%rax
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
movb   $0x0,(%rax)
mov    -0x20(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<seekp>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
call   1040 <scanp@plt>
mov    %rax,%r12
movzbl (%rax),%edi
call   1030 <isspace@plt>
mov    %r12,%rbx
test   %eax,%eax
jne    1180 <seekp+0x60>
movabs $0xc00000000000001,%r13
mov    %r12,%rbx
jmp    1171 <seekp+0x51>
cs nopw 0x0(%rax,%rax,1)
nop
movzbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1030 <isspace@plt>
test   %eax,%eax
jne    1180 <seekp+0x60>
movzbl (%rbx),%eax
cmp    $0x3b,%rax
ja     1160 <seekp+0x40>
bt     %rax,%r13
jae    1160 <seekp+0x40>
mov    (%rbx),%al
mov    %al,(%r15)
movb   $0x0,(%rbx)
add    $0x1,%rbx
mov    %rbx,(%r14)
mov    %r12,%rax
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @seekp(i8* %0, i8* nocapture writeonly %1, i8** nocapture writeonly %2) {
%4 = tail call i8* @scanp(i8* %0)
%5 = load i8, i8* %4
%6 = tail call i32 @isspace(i8 zeroext %5)
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %16
8: ; preds = %3, %11
%9 = phi i8* [ %12, %11 ], [ %4, %3 ]
%10 = load i8, i8* %9
switch i8 %10, label %11 [
i8 0, label %16
i8 58, label %16
i8 59, label %16
]
11: ; preds = %8
%12 = getelementptr inbounds i8, i8* %9, i64 1
%13 = load i8, i8* %12
%14 = tail call i32 @isspace(i8 zeroext %13)
%15 = icmp eq i32 %14, 0
br i1 %15, label %8, label %16
16: ; preds = %11, %8, %8, %8, %3
%17 = phi i8* [ %4, %3 ], [ %9, %8 ], [ %9, %8 ], [ %9, %8 ], [ %12, %11 ]
%18 = load i8, i8* %17
store i8 %18, i8* %1
%19 = getelementptr inbounds i8, i8* %17, i64 1
store i8 0, i8* %17
store i8* %19, i8** %2
ret i8* %4
}