#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 */
char *strchr(char const *, char);
int strlen(char const *);
int parse_suite_name(const char *line, char **suite_name, int *len) {
  const char *tmp = line;
  char *next;
  *suite_name = (char *)line;
  next = strchr(tmp, '/');
  if (next) {
    *len = next - tmp;
  } else {
    *len = strlen(line);
  }
  return 1;
}


x86 assembly (clang, -O0):
<parse_suite_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rdi
mov    $0x2f,%esi
call   1040 <strchr@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     117c <parse_suite_name+0x5c>
mov    -0x28(%rbp),%rax
mov    -0x20(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
jmp    118d <parse_suite_name+0x6d>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    $0x1,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_suite_name>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,%rbx
mov    %rdi,(%rsi)
mov    $0x2f,%esi
call   1040 <strchr@plt>
test   %rax,%rax
je     1140 <parse_suite_name+0x20>
sub    %ebx,%eax
jmp    1148 <parse_suite_name+0x28>
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %eax,(%r14)
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @parse_suite_name(i8* %0, i8** %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %4
store i8** %1, i8*** %5
store i32* %2, i32** %6
%9 = load i8*, i8** %4
store i8* %9, i8** %7
%10 = load i8*, i8** %4
%11 = load i8**, i8*** %5
store i8* %10, i8** %11
%12 = load i8*, i8** %7
%13 = call i8* @strchr(i8* %12, i8 signext 47)
store i8* %13, i8** %8
%14 = load i8*, i8** %8
%15 = icmp ne i8* %14, null
br i1 %15, label %16, label %24
16: ; preds = %3
%17 = load i8*, i8** %8
%18 = load i8*, i8** %7
%19 = ptrtoint i8* %17 to i64
%20 = ptrtoint i8* %18 to i64
%21 = sub i64 %19, %20
%22 = trunc i64 %21 to i32
%23 = load i32*, i32** %6
store i32 %22, i32* %23
br label %28
24: ; preds = %3
%25 = load i8*, i8** %4
%26 = call i32 @strlen(i8* %25)
%27 = load i32*, i32** %6
store i32 %26, i32* %27
br label %28
28: ; preds = %24, %16
ret i32 1
}

LLVM IR (-O2):
define i32 @parse_suite_name(i8* %0, i8** nocapture writeonly %1, i32* nocapture writeonly %2) {
store i8* %0, i8** %1
%4 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 47)
%5 = icmp eq i8* %4, null
br i1 %5, label %11, label %6
6: ; preds = %3
%7 = ptrtoint i8* %4 to i64
%8 = ptrtoint i8* %0 to i64
%9 = sub i64 %7, %8
%10 = trunc i64 %9 to i32
br label %13
11: ; preds = %3
%12 = tail call i32 @strlen(i8* %0)
br label %13
13: ; preds = %11, %6
%14 = phi i32 [ %12, %11 ], [ %10, %6 ]
store i32 %14, i32* %2
ret i32 1
}