#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);
scalar_t__ path_starts_with(char *, char *);
void test_path_starts_with() {
  assert(path_starts_with("/", "/bar/11") > 0);
  assert(path_starts_with("/", "/") > 0);
  assert(path_starts_with("/bar", "/bar/11") > 0);
  assert(path_starts_with("/bar", "/bar/") > 0);
  assert(path_starts_with("/bar", "/bar") > 0);
  assert(path_starts_with("/bar", "/bar1") == 0);
  assert(path_starts_with("/bar/", "/bar/11") > 0);
}


x86 assembly (clang, -O0):
<test_path_starts_with>:
push   %rbp
mov    %rsp,%rbp
lea    0xee6(%rip),%rdi
lea    0xece(%rip),%rsi
call   1040 <path_starts_with@plt>
cmp    $0x0,%rax
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
lea    0xec2(%rip),%rsi
mov    %rsi,%rdi
call   1040 <path_starts_with@plt>
cmp    $0x0,%rax
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
lea    0xe99(%rip),%rdi
lea    0xe8a(%rip),%rsi
call   1040 <path_starts_with@plt>
cmp    $0x0,%rax
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
lea    0xe75(%rip),%rdi
lea    0xe73(%rip),%rsi
call   1040 <path_starts_with@plt>
cmp    $0x0,%rax
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
lea    0xe51(%rip),%rsi
mov    %rsi,%rdi
call   1040 <path_starts_with@plt>
cmp    $0x0,%rax
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
lea    0xe31(%rip),%rdi
lea    0xe35(%rip),%rsi
call   1040 <path_starts_with@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
lea    0xe12(%rip),%rdi
lea    0xdfe(%rip),%rsi
call   1040 <path_starts_with@plt>
cmp    $0x0,%rax
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_path_starts_with>:
push   %r15
push   %r14
push   %rbx
lea    0xee5(%rip),%rbx
lea    0xecd(%rip),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <path_starts_with@plt>
xor    %edi,%edi
test   %rax,%rax
setg   %dil
call   1030 <assert@plt>
mov    %rbx,%rdi
mov    %rbx,%rsi
call   1040 <path_starts_with@plt>
xor    %edi,%edi
test   %rax,%rax
setg   %dil
call   1030 <assert@plt>
lea    0xe9c(%rip),%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <path_starts_with@plt>
xor    %edi,%edi
test   %rax,%rax
setg   %dil
call   1030 <assert@plt>
lea    0xe81(%rip),%r15
mov    %rbx,%rdi
mov    %r15,%rsi
call   1040 <path_starts_with@plt>
xor    %edi,%edi
test   %rax,%rax
setg   %dil
call   1030 <assert@plt>
mov    %rbx,%rdi
mov    %rbx,%rsi
call   1040 <path_starts_with@plt>
xor    %edi,%edi
test   %rax,%rax
setg   %dil
call   1030 <assert@plt>
lea    0xe4e(%rip),%rsi
mov    %rbx,%rdi
call   1040 <path_starts_with@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1030 <assert@plt>
mov    %r15,%rdi
mov    %r14,%rsi
call   1040 <path_starts_with@plt>
xor    %edi,%edi
test   %rax,%rax
setg   %dil
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <assert@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"/\00"
@.str.1 = [8 x i8] c"/bar/11\00"
@.str.2 = [5 x i8] c"/bar\00"
@.str.3 = [6 x i8] c"/bar/\00"
@.str.4 = [6 x i8] c"/bar1\00"
define void @test_path_starts_with() {
%1 = call i64 @path_starts_with(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp sgt i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @assert(i32 %3)
%5 = call i64 @path_starts_with(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = icmp sgt i64 %5, 0
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = call i64 @path_starts_with(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%10 = icmp sgt i64 %9, 0
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = call i64 @path_starts_with(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%14 = icmp sgt i64 %13, 0
%15 = zext i1 %14 to i32
%16 = call i32 @assert(i32 %15)
%17 = call i64 @path_starts_with(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%18 = icmp sgt i64 %17, 0
%19 = zext i1 %18 to i32
%20 = call i32 @assert(i32 %19)
%21 = call i64 @path_starts_with(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%22 = icmp eq i64 %21, 0
%23 = zext i1 %22 to i32
%24 = call i32 @assert(i32 %23)
%25 = call i64 @path_starts_with(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%26 = icmp sgt i64 %25, 0
%27 = zext i1 %26 to i32
%28 = call i32 @assert(i32 %27)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"/\00"
@.str.1 = [8 x i8] c"/bar/11\00"
@.str.2 = [5 x i8] c"/bar\00"
@.str.3 = [6 x i8] c"/bar/\00"
@.str.4 = [6 x i8] c"/bar1\00"
define void @test_path_starts_with() {
%1 = tail call i64 @path_starts_with(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp sgt i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i64 @path_starts_with(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = icmp sgt i64 %5, 0
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = tail call i64 @path_starts_with(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%10 = icmp sgt i64 %9, 0
%11 = zext i1 %10 to i32
%12 = tail call i32 @assert(i32 %11)
%13 = tail call i64 @path_starts_with(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%14 = icmp sgt i64 %13, 0
%15 = zext i1 %14 to i32
%16 = tail call i32 @assert(i32 %15)
%17 = tail call i64 @path_starts_with(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%18 = icmp sgt i64 %17, 0
%19 = zext i1 %18 to i32
%20 = tail call i32 @assert(i32 %19)
%21 = tail call i64 @path_starts_with(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%22 = icmp eq i64 %21, 0
%23 = zext i1 %22 to i32
%24 = tail call i32 @assert(i32 %23)
%25 = tail call i64 @path_starts_with(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%26 = icmp sgt i64 %25, 0
%27 = zext i1 %26 to i32
%28 = tail call i32 @assert(i32 %27)
ret void
}