#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 */
typedef int /*<<< orphan*/ argv;

/* Variables and functions */
int csc_fixtoken(char *, char **, int, char *);
int csc_ziptoken(char *, char **, int, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int fixtoken_test(char *content, char *delim) {
  char buf[256], *argv[32];
  int i, argc;
  ;
  strcpy(buf, content);
  argc = csc_fixtoken(buf, argv, sizeof(argv) / sizeof(char *), delim);
  ;
  for (i = 0; i < argc; i++) {
    ;
  };
  strcpy(buf, content);
  argc = csc_ziptoken(buf, argv, sizeof(argv) / sizeof(char *), delim);
  ;
  for (i = 0; i < argc; i++) {
    ;
  };
  strcpy(buf, content);
  return 0;
}


x86 assembly (clang, -O0):
<fixtoken_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x220,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x110(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <strcpy@plt>
lea    -0x110(%rbp),%rdi
lea    -0x210(%rbp),%rsi
mov    -0x10(%rbp),%rcx
mov    $0x20,%edx
call   1030 <csc_fixtoken@plt>
mov    %eax,-0x218(%rbp)
movl   $0x0,-0x214(%rbp)
mov    -0x214(%rbp),%eax
cmp    -0x218(%rbp),%eax
jge    11aa <fixtoken_test+0x7a>
jmp    1196 <fixtoken_test+0x66>
mov    -0x214(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x214(%rbp)
jmp    117f <fixtoken_test+0x4f>
lea    -0x110(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <strcpy@plt>
lea    -0x110(%rbp),%rdi
lea    -0x210(%rbp),%rsi
mov    -0x10(%rbp),%rcx
mov    $0x20,%edx
call   1050 <csc_ziptoken@plt>
mov    %eax,-0x218(%rbp)
movl   $0x0,-0x214(%rbp)
mov    -0x214(%rbp),%eax
cmp    -0x218(%rbp),%eax
jge    1211 <fixtoken_test+0xe1>
jmp    11fd <fixtoken_test+0xcd>
mov    -0x214(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x214(%rbp)
jmp    11e6 <fixtoken_test+0xb6>
lea    -0x110(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <strcpy@plt>
xor    %eax,%eax
add    $0x220,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fixtoken_test>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x208,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0x100(%rsp),%r15
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <strcpy@plt>
mov    %rsp,%r12
mov    %r15,%rdi
mov    %r12,%rsi
mov    $0x20,%edx
mov    %r14,%rcx
call   1030 <csc_fixtoken@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <strcpy@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    $0x20,%edx
mov    %r14,%rcx
call   1050 <csc_ziptoken@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <strcpy@plt>
xor    %eax,%eax
add    $0x208,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @fixtoken_test(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [256 x i8]
%6 = alloca [32 x i8*]
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%9 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%10 = load i8*, i8** %3
%11 = call i32 @strcpy(i8* %9, i8* %10)
%12 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%13 = getelementptr inbounds [32 x i8*], [32 x i8*]* %6, i64 0, i64 0
%14 = load i8*, i8** %4
%15 = call i32 @csc_fixtoken(i8* %12, i8** %13, i32 32, i8* %14)
store i32 %15, i32* %8
store i32 0, i32* %7
br label %16
16: ; preds = %21, %2
%17 = load i32, i32* %7
%18 = load i32, i32* %8
%19 = icmp slt i32 %17, %18
br i1 %19, label %20, label %24
20: ; preds = %16
br label %21
21: ; preds = %20
%22 = load i32, i32* %7
%23 = add nsw i32 %22, 1
store i32 %23, i32* %7
br label %16
24: ; preds = %16
%25 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%26 = load i8*, i8** %3
%27 = call i32 @strcpy(i8* %25, i8* %26)
%28 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%29 = getelementptr inbounds [32 x i8*], [32 x i8*]* %6, i64 0, i64 0
%30 = load i8*, i8** %4
%31 = call i32 @csc_ziptoken(i8* %28, i8** %29, i32 32, i8* %30)
store i32 %31, i32* %8
store i32 0, i32* %7
br label %32
32: ; preds = %37, %24
%33 = load i32, i32* %7
%34 = load i32, i32* %8
%35 = icmp slt i32 %33, %34
br i1 %35, label %36, label %40
36: ; preds = %32
br label %37
37: ; preds = %36
%38 = load i32, i32* %7
%39 = add nsw i32 %38, 1
store i32 %39, i32* %7
br label %32
40: ; preds = %32
%41 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%42 = load i8*, i8** %3
%43 = call i32 @strcpy(i8* %41, i8* %42)
ret i32 0
}

LLVM IR (-O2):
define i32 @fixtoken_test(i8* %0, i8* %1) {
%3 = alloca [256 x i8]
%4 = alloca [32 x i8*]
%5 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%6 = bitcast [32 x i8*]* %4 to i8*
%7 = call i32 @strcpy(i8* %5, i8* %0)
%8 = getelementptr inbounds [32 x i8*], [32 x i8*]* %4, i64 0, i64 0
%9 = call i32 @csc_fixtoken(i8* %5, i8** %8, i32 32, i8* %1)
%10 = call i32 @strcpy(i8* %5, i8* %0)
%11 = call i32 @csc_ziptoken(i8* %5, i8** %8, i32 32, i8* %1)
%12 = call i32 @strcpy(i8* %5, i8* %0)
ret i32 0
}