#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*/ assert(int);
int split(char const *);
int main() {
  const char *str1 = "a1:b2:c3:d4";
  const char *str2 = "abc";
  const char *str3 = (char *)0;
  const char *str4 = "";
  assert(split(str3) == 0);
  assert(split(str2) == 1);
  assert(split(str1) == 4);
  assert(split(str4) == 0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    0xed2(%rip),%rax
mov    %rax,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
lea    0xebe(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <split@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x10(%rbp),%rdi
call   1030 <split@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rdi
call   1030 <split@plt>
cmp    $0x4,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x20(%rbp),%rdi
call   1030 <split@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <split@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1040 <assert@plt>
lea    0xed0(%rip),%rdi
call   1030 <split@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
call   1040 <assert@plt>
lea    0xeaa(%rip),%rdi
call   1030 <split@plt>
xor    %edi,%edi
cmp    $0x4,%eax
sete   %dil
call   1040 <assert@plt>
lea    0xe9b(%rip),%rdi
call   1030 <split@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1040 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"a1:b2:c3:d4\00"
@.str.1 = [4 x i8] c"abc\00"
@.str.2 = [1 x i8] zeroinitializer
define i32 @main() {
%1 = alloca i8*
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8** %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8** %2
store i8* null, i8** %3
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8** %4
%5 = load i8*, i8** %3
%6 = call i32 @split(i8* %5)
%7 = icmp eq i32 %6, 0
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = load i8*, i8** %2
%11 = call i32 @split(i8* %10)
%12 = icmp eq i32 %11, 1
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
%15 = load i8*, i8** %1
%16 = call i32 @split(i8* %15)
%17 = icmp eq i32 %16, 4
%18 = zext i1 %17 to i32
%19 = call i32 @assert(i32 %18)
%20 = load i8*, i8** %4
%21 = call i32 @split(i8* %20)
%22 = icmp eq i32 %21, 0
%23 = zext i1 %22 to i32
%24 = call i32 @assert(i32 %23)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"a1:b2:c3:d4\00"
@.str.1 = [4 x i8] c"abc\00"
@.str.2 = [1 x i8] zeroinitializer
define i32 @main() {
%1 = tail call i32 @split(i8* null)
%2 = icmp eq i32 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 @split(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i32 %5, 1
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = tail call i32 @split(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%10 = icmp eq i32 %9, 4
%11 = zext i1 %10 to i32
%12 = tail call i32 @assert(i32 %11)
%13 = tail call i32 @split(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
%14 = icmp eq i32 %13, 0
%15 = zext i1 %14 to i32
%16 = tail call i32 @assert(i32 %15)
ret i32 0
}