#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 */
const char *unit_extract_test_name(const char *suite_test_name) {
  int state = 0;
  while (*suite_test_name) {
    if (state == 0 && *suite_test_name == ':') {
      state = 1;
    } else if (state == 1 && *suite_test_name == ':') {
      state = 2;
    } else if (state == 2) {
      break;
    }
    suite_test_name++;
  }
  if (state == 2) {
    return suite_test_name;
  } else {
    return NULL;
  }
}


x86 assembly (clang, -O0):
<unit_extract_test_name>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1192 <unit_extract_test_name+0x92>
cmpl   $0x0,-0x14(%rbp)
jne    1142 <unit_extract_test_name+0x42>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3a,%eax
jne    1142 <unit_extract_test_name+0x42>
movl   $0x1,-0x14(%rbp)
jmp    1181 <unit_extract_test_name+0x81>
cmpl   $0x1,-0x14(%rbp)
jne    1168 <unit_extract_test_name+0x68>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3a,%eax
jne    1168 <unit_extract_test_name+0x68>
movl   $0x2,-0x14(%rbp)
jmp    117c <unit_extract_test_name+0x7c>
cmpl   $0x2,-0x14(%rbp)
jne    1177 <unit_extract_test_name+0x77>
jmp    1192 <unit_extract_test_name+0x92>
jmp    117c <unit_extract_test_name+0x7c>
jmp    1181 <unit_extract_test_name+0x81>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110f <unit_extract_test_name+0xf>
cmpl   $0x2,-0x14(%rbp)
jne    11a9 <unit_extract_test_name+0xa9>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    11b1 <unit_extract_test_name+0xb1>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<unit_extract_test_name>:
mov    (%rdi),%dl
xor    %ecx,%ecx
test   %dl,%dl
je     114e <unit_extract_test_name+0x4e>
mov    %rdi,%rax
jmp    1127 <unit_extract_test_name+0x27>
nopl   (%rax)
xor    %ecx,%ecx
cmp    $0x3a,%dl
sete   %cl
add    $0x1,%ecx
movzbl 0x1(%rax),%edx
add    $0x1,%rax
test   %dl,%dl
je     1144 <unit_extract_test_name+0x44>
mov    %ecx,%esi
test   %ecx,%ecx
jne    1137 <unit_extract_test_name+0x37>
mov    $0x1,%ecx
cmp    $0x3a,%dl
je     111b <unit_extract_test_name+0x1b>
cmp    $0x1,%esi
je     1110 <unit_extract_test_name+0x10>
mov    %esi,%ecx
cmp    $0x2,%esi
jne    111b <unit_extract_test_name+0x1b>
ret
xor    %edx,%edx
cmp    $0x2,%ecx
cmovne %rdx,%rax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i8* @unit_extract_test_name(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 0, i32* %4
br label %5
5: ; preds = %33, %1
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %36
9: ; preds = %5
%10 = load i32, i32* %4
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %18
12: ; preds = %9
%13 = load i8*, i8** %3
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %15, 58
br i1 %16, label %17, label %18
17: ; preds = %12
store i32 1, i32* %4
br label %33
18: ; preds = %12, %9
%19 = load i32, i32* %4
%20 = icmp eq i32 %19, 1
br i1 %20, label %21, label %27
21: ; preds = %18
%22 = load i8*, i8** %3
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
%25 = icmp eq i32 %24, 58
br i1 %25, label %26, label %27
26: ; preds = %21
store i32 2, i32* %4
br label %32
27: ; preds = %21, %18
%28 = load i32, i32* %4
%29 = icmp eq i32 %28, 2
br i1 %29, label %30, label %31
30: ; preds = %27
br label %36
31: ; preds = %27
br label %32
32: ; preds = %31, %26
br label %33
33: ; preds = %32, %17
%34 = load i8*, i8** %3
%35 = getelementptr inbounds i8, i8* %34, i32 1
store i8* %35, i8** %3
br label %5
36: ; preds = %30, %5
%37 = load i32, i32* %4
%38 = icmp eq i32 %37, 2
br i1 %38, label %39, label %41
39: ; preds = %36
%40 = load i8*, i8** %3
store i8* %40, i8** %2
br label %42
41: ; preds = %36
store i8* null, i8** %2
br label %42
42: ; preds = %41, %39
%43 = load i8*, i8** %2
ret i8* %43
}

LLVM IR (-O2):
define i8* @unit_extract_test_name(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %22, label %4
4: ; preds = %1, %14
%5 = phi i8 [ %17, %14 ], [ %2, %1 ]
%6 = phi i32 [ %15, %14 ], [ 0, %1 ]
%7 = phi i8* [ %16, %14 ], [ %0, %1 ]
%8 = icmp eq i32 %6, 0
%9 = icmp eq i8 %5, 58
%10 = select i1 %8, i1 %9, i1 false
br i1 %10, label %14, label %11
11: ; preds = %4
switch i32 %6, label %14 [
i32 1, label %12
i32 2, label %22
]
12: ; preds = %11
%13 = select i1 %9, i32 2, i32 1
br label %14
14: ; preds = %12, %11, %4
%15 = phi i32 [ 1, %4 ], [ %6, %11 ], [ %13, %12 ]
%16 = getelementptr inbounds i8, i8* %7, i64 1
%17 = load i8, i8* %16
%18 = icmp eq i8 %17, 0
br i1 %18, label %19, label %4
19: ; preds = %14
%20 = icmp eq i32 %15, 2
%21 = select i1 %20, i8* %16, i8* null
br label %22
22: ; preds = %11, %19, %1
%23 = phi i8* [ null, %1 ], [ %21, %19 ], [ %7, %11 ]
ret i8* %23
}