#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*/ strcpy(char *, char *);
int /*<<< orphan*/ strncpy(char *, char *, int);
char *seperation(char *input, char *pware, char *ppro, char *pquali) {
  int count, b = 0;
  strcpy(input, "ATL1203S14");
  for (count = 0; count < 100; ++count) {
    if (*input >= 'A' && *input <= 'Z' && *(input - 1) > '9' &&
        *(input + 1) > '9') {
      strncpy(pware, input, 3);
      pware[3] = '\0';
      input = input + 3;
    } else if (*input >= '0' && *input <= '9' && b != 1) {
      strncpy(ppro, input, 4);
      ppro[4] = '\0';
      ++b;
      input = input + 4;
    } else {
      strncpy(pquali, input, 3);
      pquali[3] = '\0';
      count = count + 100;
    }
  }
}


x86 assembly (clang, -O0):
<seperation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
movl   $0x0,-0x30(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xeb6(%rip),%rsi
call   1040 <strcpy@plt>
movl   $0x0,-0x2c(%rbp)
cmpl   $0x64,-0x2c(%rbp)
jge    1266 <seperation+0x146>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x41,%eax
jl     11cd <seperation+0xad>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5a,%eax
jg     11cd <seperation+0xad>
mov    -0x10(%rbp),%rax
movsbl -0x1(%rax),%eax
cmp    $0x39,%eax
jle    11cd <seperation+0xad>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x39,%eax
jle    11cd <seperation+0xad>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x3,%edx
call   1030 <strncpy@plt>
mov    -0x18(%rbp),%rax
movb   $0x0,0x3(%rax)
mov    -0x10(%rbp),%rax
add    $0x3,%rax
mov    %rax,-0x10(%rbp)
jmp    1253 <seperation+0x133>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x30,%eax
jl     122b <seperation+0x10b>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x39,%eax
jg     122b <seperation+0x10b>
cmpl   $0x1,-0x30(%rbp)
je     122b <seperation+0x10b>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x4,%edx
call   1030 <strncpy@plt>
mov    -0x20(%rbp),%rax
movb   $0x0,0x4(%rax)
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x10(%rbp)
jmp    124e <seperation+0x12e>
mov    -0x28(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x3,%edx
call   1030 <strncpy@plt>
mov    -0x28(%rbp),%rax
movb   $0x0,0x3(%rax)
mov    -0x2c(%rbp),%eax
add    $0x64,%eax
mov    %eax,-0x2c(%rbp)
jmp    1253 <seperation+0x133>
jmp    1258 <seperation+0x138>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1156 <seperation+0x36>
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<seperation>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r12
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%r13
lea    0xec2(%rip),%rsi
call   1040 <strcpy@plt>
xor    %ebp,%ebp
xor    %ebx,%ebx
jmp    1173 <seperation+0x53>
nopl   0x0(%rax)
mov    %r12,%rdi
mov    %r13,%rsi
mov    $0x3,%edx
call   1030 <strncpy@plt>
movb   $0x0,0x3(%r12)
add    $0x64,%ebx
lea    0x1(%rbx),%eax
cmp    $0x63,%ebx
mov    %eax,%ebx
jge    11dd <seperation+0xbd>
movzbl 0x0(%r13),%eax
lea    -0x41(%rax),%ecx
cmp    $0x19,%cl
ja     11b0 <seperation+0x90>
cmpb   $0x3a,-0x1(%r13)
jl     1150 <seperation+0x30>
cmpb   $0x3a,0x1(%r13)
jl     1150 <seperation+0x30>
mov    %r15,%rdi
mov    %r13,%rsi
mov    $0x3,%edx
call   1030 <strncpy@plt>
movb   $0x0,0x3(%r15)
add    $0x3,%r13
jmp    1169 <seperation+0x49>
nopl   0x0(%rax)
cmp    $0x30,%al
jl     1150 <seperation+0x30>
cmp    $0x39,%al
ja     1150 <seperation+0x30>
cmp    $0x1,%ebp
je     1150 <seperation+0x30>
mov    %r14,%rdi
mov    %r13,%rsi
mov    $0x4,%edx
call   1030 <strncpy@plt>
movb   $0x0,0x4(%r14)
add    $0x4,%r13
mov    $0x1,%ebp
jmp    1169 <seperation+0x49>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [11 x i8] c"ATL1203S14\00"
define noalias i8* @seperation(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = tail call i32 @strcpy(i8* %0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%6 = getelementptr inbounds i8, i8* %2, i64 4
%7 = getelementptr inbounds i8, i8* %3, i64 3
%8 = getelementptr inbounds i8, i8* %1, i64 3
br label %9
9: ; preds = %4, %39
%10 = phi i32 [ 0, %4 ], [ %42, %39 ]
%11 = phi i32 [ 0, %4 ], [ %43, %39 ]
%12 = phi i8* [ %0, %4 ], [ %40, %39 ]
%13 = load i8, i8* %12
%14 = add i8 %13, -65
%15 = icmp ult i8 %14, 26
br i1 %15, label %16, label %27
16: ; preds = %9
%17 = getelementptr inbounds i8, i8* %12, i64 -1
%18 = load i8, i8* %17
%19 = icmp sgt i8 %18, 57
br i1 %19, label %20, label %36
20: ; preds = %16
%21 = getelementptr inbounds i8, i8* %12, i64 1
%22 = load i8, i8* %21
%23 = icmp sgt i8 %22, 57
br i1 %23, label %24, label %36
24: ; preds = %20
%25 = tail call i32 @strncpy(i8* %1, i8* %12, i32 3)
store i8 0, i8* %8
%26 = getelementptr inbounds i8, i8* %12, i64 3
br label %39
27: ; preds = %9
%28 = icmp sgt i8 %13, 47
br i1 %28, label %29, label %36
29: ; preds = %27
%30 = icmp ult i8 %13, 58
%31 = icmp ne i32 %10, 1
%32 = select i1 %30, i1 %31, i1 false
br i1 %32, label %33, label %36
33: ; preds = %29
%34 = tail call i32 @strncpy(i8* %2, i8* %12, i32 4)
store i8 0, i8* %6
%35 = getelementptr inbounds i8, i8* %12, i64 4
br label %39
36: ; preds = %20, %16, %29, %27
%37 = tail call i32 @strncpy(i8* %3, i8* %12, i32 3)
store i8 0, i8* %7
%38 = add nsw i32 %11, 100
br label %39
39: ; preds = %24, %36, %33
%40 = phi i8* [ %26, %24 ], [ %35, %33 ], [ %12, %36 ]
%41 = phi i32 [ %11, %24 ], [ %11, %33 ], [ %38, %36 ]
%42 = phi i32 [ %10, %24 ], [ 1, %33 ], [ %10, %36 ]
%43 = add nsw i32 %41, 1
%44 = icmp slt i32 %41, 99
br i1 %44, label %9, label %45
45: ; preds = %39
ret i8* undef
}