#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 strlen(char *);
char *strtok(char *, char *);
int splitConnectRequest(char *request, int size, char *login, char *password,
                        int *sizeLogin, int *sizePassword) {
  login = NULL;
  password = NULL;
  *sizeLogin = 0;
  *sizePassword = 0;
  if (size > 64 || size <= 0) {
    return -12;
  }
  login = strtok(&request[8], ";");
  password = strtok(&request[8 + strlen(login) - 1], ";");
  *sizeLogin = (strlen(login) > 27) ? 27 : strlen(login);
  *sizePassword = (strlen(password) > 26) ? 26 : strlen(password);
  return (*sizeLogin == 0 || *sizePassword == 0) ? -17 : -10;
}


x86 assembly (clang, -O0):
<splitConnectRequest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    %r9,-0x38(%rbp)
movq   $0x0,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x30(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x38(%rbp),%rax
movl   $0x0,(%rax)
cmpl   $0x40,-0x14(%rbp)
jg     1177 <splitConnectRequest+0x57>
cmpl   $0x0,-0x14(%rbp)
jg     1183 <splitConnectRequest+0x63>
movl   $0xfffffff4,-0x4(%rbp)
jmp    1268 <splitConnectRequest+0x148>
mov    -0x10(%rbp),%rdi
add    $0x8,%rdi
lea    0xe6e(%rip),%rsi
call   1040 <strtok@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x40(%rbp),%rdi
add    $0x8,%eax
sub    $0x1,%eax
cltq
add    %rax,%rdi
lea    0xe3e(%rip),%rsi
call   1040 <strtok@plt>
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x1b,%eax
jle    11ea <splitConnectRequest+0xca>
mov    $0x1b,%eax
mov    %eax,-0x44(%rbp)
jmp    11f6 <splitConnectRequest+0xd6>
mov    -0x20(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x44(%rbp)
mov    -0x44(%rbp),%ecx
mov    -0x30(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x28(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x1a,%eax
jle    121e <splitConnectRequest+0xfe>
mov    $0x1a,%eax
mov    %eax,-0x48(%rbp)
jmp    122a <splitConnectRequest+0x10a>
mov    -0x28(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x48(%rbp)
mov    -0x48(%rbp),%ecx
mov    -0x38(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x30(%rbp),%rcx
mov    $0x1,%al
cmpl   $0x0,(%rcx)
mov    %al,-0x49(%rbp)
je     1252 <splitConnectRequest+0x132>
mov    -0x38(%rbp),%rax
cmpl   $0x0,(%rax)
sete   %al
mov    %al,-0x49(%rbp)
mov    -0x49(%rbp),%dl
mov    $0xfffffff6,%eax
mov    $0xffffffef,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<splitConnectRequest>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
movl   $0x0,(%r8)
movl   $0x0,(%r9)
add    $0xffffffbf,%esi
mov    $0xfffffff4,%eax
cmp    $0xffffffc0,%esi
jb     11e6 <splitConnectRequest+0xc6>
mov    %r9,%r14
mov    %r8,%r12
mov    %rdi,%rbx
add    $0x8,%rdi
lea    0xea4(%rip),%r15
mov    %r15,%rsi
call   1040 <strtok@plt>
mov    %rax,%r13
mov    %rax,%rdi
call   1030 <strlen@plt>
cltq
lea    (%rax,%rbx,1),%rdi
add    $0x7,%rdi
mov    %r15,%rsi
call   1040 <strtok@plt>
mov    %rax,%r15
mov    %r13,%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    $0x1b,%eax
cmp    $0x1b,%ecx
jg     11a0 <splitConnectRequest+0x80>
mov    %r13,%rdi
call   1030 <strlen@plt>
mov    %eax,(%r12)
mov    %r15,%rdi
call   1030 <strlen@plt>
cmp    $0x1b,%eax
jl     11bf <splitConnectRequest+0x9f>
movl   $0x1a,(%r14)
mov    $0xfffffff6,%ecx
jmp    11d9 <splitConnectRequest+0xb9>
mov    %r15,%rdi
call   1030 <strlen@plt>
mov    %eax,(%r14)
test   %eax,%eax
mov    $0xffffffef,%eax
mov    $0xfffffff6,%ecx
cmove  %eax,%ecx
cmpl   $0x0,(%r12)
mov    $0xffffffef,%eax
cmovne %ecx,%eax
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [2 x i8] c";\00"
define i32 @splitConnectRequest(i8* %0, i32 %1, i8* %2, i8* %3, i32* %4, i32* %5) {
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i32*
%13 = alloca i32*
store i8* %0, i8** %8
store i32 %1, i32* %9
store i8* %2, i8** %10
store i8* %3, i8** %11
store i32* %4, i32** %12
store i32* %5, i32** %13
store i8* null, i8** %10
store i8* null, i8** %11
%14 = load i32*, i32** %12
store i32 0, i32* %14
%15 = load i32*, i32** %13
store i32 0, i32* %15
%16 = load i32, i32* %9
%17 = icmp sgt i32 %16, 64
br i1 %17, label %21, label %18
18: ; preds = %6
%19 = load i32, i32* %9
%20 = icmp sle i32 %19, 0
br i1 %20, label %21, label %22
21: ; preds = %18, %6
store i32 -12, i32* %7
br label %65
22: ; preds = %18
%23 = load i8*, i8** %8
%24 = getelementptr inbounds i8, i8* %23, i64 8
%25 = call i8* @strtok(i8* %24, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i8* %25, i8** %10
%26 = load i8*, i8** %8
%27 = load i8*, i8** %10
%28 = call i32 @strlen(i8* %27)
%29 = add nsw i32 8, %28
%30 = sub nsw i32 %29, 1
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds i8, i8* %26, i64 %31
%33 = call i8* @strtok(i8* %32, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i8* %33, i8** %11
%34 = load i8*, i8** %10
%35 = call i32 @strlen(i8* %34)
%36 = icmp sgt i32 %35, 27
br i1 %36, label %37, label %38
37: ; preds = %22
br label %41
38: ; preds = %22
%39 = load i8*, i8** %10
%40 = call i32 @strlen(i8* %39)
br label %41
41: ; preds = %38, %37
%42 = phi i32 [ 27, %37 ], [ %40, %38 ]
%43 = load i32*, i32** %12
store i32 %42, i32* %43
%44 = load i8*, i8** %11
%45 = call i32 @strlen(i8* %44)
%46 = icmp sgt i32 %45, 26
br i1 %46, label %47, label %48
47: ; preds = %41
br label %51
48: ; preds = %41
%49 = load i8*, i8** %11
%50 = call i32 @strlen(i8* %49)
br label %51
51: ; preds = %48, %47
%52 = phi i32 [ 26, %47 ], [ %50, %48 ]
%53 = load i32*, i32** %13
store i32 %52, i32* %53
%54 = load i32*, i32** %12
%55 = load i32, i32* %54
%56 = icmp eq i32 %55, 0
br i1 %56, label %61, label %57
57: ; preds = %51
%58 = load i32*, i32** %13
%59 = load i32, i32* %58
%60 = icmp eq i32 %59, 0
br label %61
61: ; preds = %57, %51
%62 = phi i1 [ true, %51 ], [ %60, %57 ]
%63 = zext i1 %62 to i64
%64 = select i1 %62, i32 -17, i32 -10
store i32 %64, i32* %7
br label %65
65: ; preds = %61, %21
%66 = load i32, i32* %7
ret i32 %66
}

LLVM IR (-O2):
@.str = [2 x i8] c";\00"
define i32 @splitConnectRequest(i8* %0, i32 %1, i8* nocapture readnone %2, i8* nocapture readnone %3, i32* nocapture %4, i32* nocapture writeonly %5) {
store i32 0, i32* %4
store i32 0, i32* %5
%7 = add i32 %1, -65
%8 = icmp ult i32 %7, -64
br i1 %8, label %35, label %9
9: ; preds = %6
%10 = getelementptr inbounds i8, i8* %0, i64 8
%11 = tail call i8* @strtok(i8* %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%12 = tail call i32 @strlen(i8* %11)
%13 = add nsw i32 %12, 7
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %0, i64 %14
%16 = tail call i8* @strtok(i8* %15, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%17 = tail call i32 @strlen(i8* %11)
%18 = icmp sgt i32 %17, 27
br i1 %18, label %21, label %19
19: ; preds = %9
%20 = tail call i32 @strlen(i8* %11)
br label %21
21: ; preds = %9, %19
%22 = phi i32 [ %20, %19 ], [ 27, %9 ]
store i32 %22, i32* %4
%23 = tail call i32 @strlen(i8* %16)
%24 = icmp sgt i32 %23, 26
br i1 %24, label %25, label %26
25: ; preds = %21
store i32 26, i32* %5
br label %30
26: ; preds = %21
%27 = tail call i32 @strlen(i8* %16)
store i32 %27, i32* %5
%28 = icmp eq i32 %27, 0
%29 = select i1 %28, i32 -17, i32 -10
br label %30
30: ; preds = %26, %25
%31 = phi i32 [ -10, %25 ], [ %29, %26 ]
%32 = load i32, i32* %4
%33 = icmp eq i32 %32, 0
%34 = select i1 %33, i32 -17, i32 %31
br label %35
35: ; preds = %6, %30
%36 = phi i32 [ %34, %30 ], [ -12, %6 ]
ret i32 %36
}