#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*/ printf(char *, char *);
int /*<<< orphan*/ split(char *, char *, char **, int *);
int main() {
  char src[] = "Accsvr:tcp  -h    127.0.0.1    -p    20018";
  char *dest[128];
  char *dest2[128];
  int num = 0, num2 = 0;
  int i, j;
  split(src, ":", dest, &num);
  for (i = 0; i < num; ++i) {
    printf("|%s|\n", dest[i]);
    split(dest[i], "\t", dest2, &num2);
    for (j = 0; j < num2; ++j) {
      printf("|%s|\n", dest2[j]);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x840,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xeb3(%rip),%rsi
mov    $0x2b,%edx
call   1050 <memcpy@plt>
movl   $0x0,-0x834(%rbp)
movl   $0x0,-0x838(%rbp)
lea    -0x30(%rbp),%rdi
lea    -0x430(%rbp),%rdx
lea    0xeae(%rip),%rsi
lea    -0x834(%rbp),%rcx
call   1040 <split@plt>
movl   $0x0,-0x83c(%rbp)
mov    -0x83c(%rbp),%eax
cmp    -0x834(%rbp),%eax
jge    124d <main+0x11d>
movslq -0x83c(%rbp),%rax
mov    -0x430(%rbp,%rax,8),%rsi
ff
lea    0xe72(%rip),%rdi
call   1030 <printf@plt>
movslq -0x83c(%rbp),%rax
mov    -0x430(%rbp,%rax,8),%rdi
ff
lea    -0x830(%rbp),%rdx
lea    0xe56(%rip),%rsi
lea    -0x838(%rbp),%rcx
call   1040 <split@plt>
movl   $0x0,-0x840(%rbp)
mov    -0x840(%rbp),%eax
cmp    -0x838(%rbp),%eax
jge    1234 <main+0x104>
movslq -0x840(%rbp),%rax
mov    -0x830(%rbp,%rax,8),%rsi
ff
lea    0xe12(%rip),%rdi
call   1030 <printf@plt>
mov    -0x840(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x840(%rbp)
jmp    11f3 <main+0xc3>
jmp    1239 <main+0x109>
mov    -0x83c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x83c(%rbp)
jmp    1193 <main+0x63>
xor    %eax,%eax
add    $0x840,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x848,%rsp
movups 0xee3(%rip),%xmm0
movups %xmm0,0x2b(%rsp)
movaps 0xecc(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xeb0(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movl   $0x0,0xc(%rsp)
movl   $0x0,0x8(%rsp)
lea    0xebf(%rip),%rsi
lea    0x10(%rsp),%rdi
lea    0x40(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1040 <split@plt>
cmpl   $0x0,0xc(%rsp)
jle    1210 <main+0xf0>
xor    %r13d,%r13d
lea    0xe98(%rip),%rbx
lea    0xe97(%rip),%r14
lea    0x440(%rsp),%r15
lea    0x8(%rsp),%r12
jmp    11be <main+0x9e>
nopl   0x0(%rax,%rax,1)
add    $0x1,%r13
movslq 0xc(%rsp),%rax
cmp    %rax,%r13
jge    1210 <main+0xf0>
mov    0x40(%rsp,%r13,8),%rsi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0x40(%rsp,%r13,8),%rdi
mov    %r14,%rsi
mov    %r15,%rdx
mov    %r12,%rcx
call   1040 <split@plt>
cmpl   $0x0,0x8(%rsp)
jle    11b0 <main+0x90>
xor    %ebp,%ebp
nopw   0x0(%rax,%rax,1)
mov    0x440(%rsp,%rbp,8),%rsi
mov    %rbx,%rdi
call   1030 <printf@plt>
add    $0x1,%rbp
movslq 0x8(%rsp),%rax
cmp    %rax,%rbp
jl     11f0 <main+0xd0>
jmp    11b0 <main+0x90>
xor    %eax,%eax
add    $0x848,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@__const.main.src = [43 x i8] c"Accsvr:tcp -h 127.0.0.1 -p 20018\00"
@.str = [2 x i8] c":\00"
@.str.1 = [6 x i8] c"|%s|\0A\00"
@.str.2 = [2 x i8] c"\09\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [43 x i8]
%3 = alloca [128 x i8*]
%4 = alloca [128 x i8*]
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %1
%9 = bitcast [43 x i8]* %2 to i8*
store i32 0, i32* %5
store i32 0, i32* %6
%10 = getelementptr inbounds [43 x i8], [43 x i8]* %2, i64 0, i64 0
%11 = getelementptr inbounds [128 x i8*], [128 x i8*]* %3, i64 0, i64 0
%12 = call i32 @split(i8* %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8** %11, i32* %5)
store i32 0, i32* %7
br label %13
13: ; preds = %43, %0
%14 = load i32, i32* %7
%15 = load i32, i32* %5
%16 = icmp slt i32 %14, %15
br i1 %16, label %17, label %46
17: ; preds = %13
%18 = load i32, i32* %7
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [128 x i8*], [128 x i8*]* %3, i64 0, i64 %19
%21 = load i8*, i8** %20
%22 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %21)
%23 = load i32, i32* %7
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [128 x i8*], [128 x i8*]* %3, i64 0, i64 %24
%26 = load i8*, i8** %25
%27 = getelementptr inbounds [128 x i8*], [128 x i8*]* %4, i64 0, i64 0
%28 = call i32 @split(i8* %26, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8** %27, i32* %6)
store i32 0, i32* %8
br label %29
29: ; preds = %39, %17
%30 = load i32, i32* %8
%31 = load i32, i32* %6
%32 = icmp slt i32 %30, %31
br i1 %32, label %33, label %42
33: ; preds = %29
%34 = load i32, i32* %8
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds [128 x i8*], [128 x i8*]* %4, i64 0, i64 %35
%37 = load i8*, i8** %36
%38 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %37)
br label %39
39: ; preds = %33
%40 = load i32, i32* %8
%41 = add nsw i32 %40, 1
store i32 %41, i32* %8
br label %29
42: ; preds = %29
br label %43
43: ; preds = %42
%44 = load i32, i32* %7
%45 = add nsw i32 %44, 1
store i32 %45, i32* %7
br label %13
46: ; preds = %13
ret i32 0
}

LLVM IR (-O2):
@__const.main.src = [43 x i8] c"Accsvr:tcp -h 127.0.0.1 -p 20018\00"
@.str = [2 x i8] c":\00"
@.str.1 = [6 x i8] c"|%s|\0A\00"
@.str.2 = [2 x i8] c"\09\00"
define i32 @main() {
%1 = alloca [43 x i8]
%2 = alloca [128 x i8*]
%3 = alloca [128 x i8*]
%4 = alloca i32
%5 = alloca i32
%6 = getelementptr inbounds [43 x i8], [43 x i8]* %1, i64 0, i64 0
%7 = bitcast [128 x i8*]* %2 to i8*
%8 = bitcast [128 x i8*]* %3 to i8*
%9 = bitcast i32* %4 to i8*
store i32 0, i32* %4
%10 = bitcast i32* %5 to i8*
store i32 0, i32* %5
%11 = getelementptr inbounds [128 x i8*], [128 x i8*]* %2, i64 0, i64 0
%12 = call i32 @split(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8** %11, i32* %4)
%13 = load i32, i32* %4
%14 = icmp sgt i32 %13, 0
br i1 %14, label %15, label %40
15: ; preds = %0
%16 = getelementptr inbounds [128 x i8*], [128 x i8*]* %3, i64 0, i64 0
br label %17
17: ; preds = %15, %35
%18 = phi i64 [ 0, %15 ], [ %36, %35 ]
%19 = getelementptr inbounds [128 x i8*], [128 x i8*]* %2, i64 0, i64 %18
%20 = load i8*, i8** %19
%21 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %20)
%22 = load i8*, i8** %19
%23 = call i32 @split(i8* %22, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8** %16, i32* %5)
%24 = load i32, i32* %5
%25 = icmp sgt i32 %24, 0
br i1 %25, label %26, label %35
26: ; preds = %17, %26
%27 = phi i64 [ %31, %26 ], [ 0, %17 ]
%28 = getelementptr inbounds [128 x i8*], [128 x i8*]* %3, i64 0, i64 %27
%29 = load i8*, i8** %28
%30 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %29)
%31 = add nuw nsw i64 %27, 1
%32 = load i32, i32* %5
%33 = sext i32 %32 to i64
%34 = icmp slt i64 %31, %33
br i1 %34, label %26, label %35
35: ; preds = %26, %17
%36 = add nuw nsw i64 %18, 1
%37 = load i32, i32* %4
%38 = sext i32 %37 to i64
%39 = icmp slt i64 %36, %38
br i1 %39, label %17, label %40
40: ; preds = %35, %0
ret i32 0
}