#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*/ strncpy(char *, char *, int);
char *seperation(char *procode, char *ware, char *pro, char *quali) {
  strncpy(ware, &procode[0], 3);
  ware[3] = '\0';
  strncpy(pro, &procode[3], 4);
  pro[4] = '\0';
  strncpy(quali, &procode[7], 3);
  quali[3] = '\0';
}


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)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x3,%edx
call   1030 <strncpy@plt>
mov    -0x18(%rbp),%rax
movb   $0x0,0x3(%rax)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
add    $0x3,%rsi
mov    $0x4,%edx
call   1030 <strncpy@plt>
mov    -0x20(%rbp),%rax
movb   $0x0,0x4(%rax)
mov    -0x28(%rbp),%rdi
mov    -0x10(%rbp),%rsi
add    $0x7,%rsi
mov    $0x3,%edx
call   1030 <strncpy@plt>
mov    -0x28(%rbp),%rax
movb   $0x0,0x3(%rax)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<seperation>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%r12
mov    %rdi,%rbx
mov    %rsi,%rdi
mov    %rbx,%rsi
mov    $0x3,%edx
call   1030 <strncpy@plt>
movb   $0x0,0x3(%r12)
lea    0x3(%rbx),%rsi
mov    %r15,%rdi
mov    $0x4,%edx
call   1030 <strncpy@plt>
movb   $0x0,0x4(%r15)
add    $0x7,%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0x3,%edx
call   1030 <strncpy@plt>
movb   $0x0,0x3(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
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*
store i8* %0, i8** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i8* %3, i8** %9
%10 = load i8*, i8** %7
%11 = load i8*, i8** %6
%12 = getelementptr inbounds i8, i8* %11, i64 0
%13 = call i32 @strncpy(i8* %10, i8* %12, i32 3)
%14 = load i8*, i8** %7
%15 = getelementptr inbounds i8, i8* %14, i64 3
store i8 0, i8* %15
%16 = load i8*, i8** %8
%17 = load i8*, i8** %6
%18 = getelementptr inbounds i8, i8* %17, i64 3
%19 = call i32 @strncpy(i8* %16, i8* %18, i32 4)
%20 = load i8*, i8** %8
%21 = getelementptr inbounds i8, i8* %20, i64 4
store i8 0, i8* %21
%22 = load i8*, i8** %9
%23 = load i8*, i8** %6
%24 = getelementptr inbounds i8, i8* %23, i64 7
%25 = call i32 @strncpy(i8* %22, i8* %24, i32 3)
%26 = load i8*, i8** %9
%27 = getelementptr inbounds i8, i8* %26, i64 3
store i8 0, i8* %27
%28 = load i8*, i8** %5
ret i8* %28
}

LLVM IR (-O2):
define noalias i8* @seperation(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = tail call i32 @strncpy(i8* %1, i8* %0, i32 3)
%6 = getelementptr inbounds i8, i8* %1, i64 3
store i8 0, i8* %6
%7 = getelementptr inbounds i8, i8* %0, i64 3
%8 = tail call i32 @strncpy(i8* %2, i8* %7, i32 4)
%9 = getelementptr inbounds i8, i8* %2, i64 4
store i8 0, i8* %9
%10 = getelementptr inbounds i8, i8* %0, i64 7
%11 = tail call i32 @strncpy(i8* %3, i8* %10, i32 3)
%12 = getelementptr inbounds i8, i8* %3, i64 3
store i8 0, i8* %12
ret i8* undef
}