#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 */
struct ct_path {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int);
struct ct_path *ct_path_alloc(char *, char *);
int ct_path_equals_path(struct ct_path *, struct ct_path *);
int /*<<< orphan*/ ct_path_free(struct ct_path *);
void test_path_equals_path(void) {
  struct ct_path *path1 = ct_path_alloc("/tmp", "foo");
  struct ct_path *path2 = ct_path_alloc("/var", "/tmp/foo");
  struct ct_path *path3 = ct_path_alloc("/tmp", "bar");
  assert(ct_path_equals_path(path1, path1));
  assert(ct_path_equals_path(path2, path2));
  assert(ct_path_equals_path(path1, path2));
  assert(ct_path_equals_path(path2, path1));
  assert(!ct_path_equals_path(path1, path3));
  assert(!ct_path_equals_path(path3, path1));
  ct_path_free(path3);
  ct_path_free(path2);
  ct_path_free(path1);
}


x86 assembly (clang, -O0):
<test_path_equals_path>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xeb1(%rip),%rdi
lea    0xeb9(%rip),%rsi
call   1060 <ct_path_alloc@plt>
mov    %rax,-0x8(%rbp)
lea    0xe9f(%rip),%rdi
lea    0xe9d(%rip),%rsi
call   1060 <ct_path_alloc@plt>
mov    %rax,-0x10(%rbp)
lea    0xe83(%rip),%rdi
lea    0xe8f(%rip),%rsi
call   1060 <ct_path_alloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1050 <ct_path_equals_path@plt>
mov    %eax,%edi
call   1040 <assert@plt>
mov    -0x10(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <ct_path_equals_path@plt>
mov    %eax,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <ct_path_equals_path@plt>
mov    %eax,%edi
call   1040 <assert@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1050 <ct_path_equals_path@plt>
mov    %eax,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1050 <ct_path_equals_path@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1050 <ct_path_equals_path@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x18(%rbp),%rdi
call   1030 <ct_path_free@plt>
mov    -0x10(%rbp),%rdi
call   1030 <ct_path_free@plt>
mov    -0x8(%rbp),%rdi
call   1030 <ct_path_free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_path_equals_path>:
push   %r15
push   %r14
push   %rbx
lea    0xeb4(%rip),%r15
lea    0xebc(%rip),%rsi
mov    %r15,%rdi
call   1060 <ct_path_alloc@plt>
mov    %rax,%rbx
lea    0xea0(%rip),%rdi
lea    0xe9e(%rip),%rsi
call   1060 <ct_path_alloc@plt>
mov    %rax,%r14
lea    0xe98(%rip),%rsi
mov    %r15,%rdi
call   1060 <ct_path_alloc@plt>
mov    %rax,%r15
mov    %rbx,%rdi
mov    %rbx,%rsi
call   1050 <ct_path_equals_path@plt>
mov    %eax,%edi
call   1040 <assert@plt>
mov    %r14,%rdi
mov    %r14,%rsi
call   1050 <ct_path_equals_path@plt>
mov    %eax,%edi
call   1040 <assert@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <ct_path_equals_path@plt>
mov    %eax,%edi
call   1040 <assert@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <ct_path_equals_path@plt>
mov    %eax,%edi
call   1040 <assert@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1050 <ct_path_equals_path@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1040 <assert@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1050 <ct_path_equals_path@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1040 <assert@plt>
mov    %r15,%rdi
call   1030 <ct_path_free@plt>
mov    %r14,%rdi
call   1030 <ct_path_free@plt>
mov    %rbx,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <ct_path_free@plt>

LLVM IR (-O0):
%struct.ct_path = type { i32 }
@.str = [5 x i8] c"/tmp\00"
@.str.1 = [4 x i8] c"foo\00"
@.str.2 = [5 x i8] c"/var\00"
@.str.3 = [9 x i8] c"/tmp/foo\00"
@.str.4 = [4 x i8] c"bar\00"
define void @test_path_equals_path() {
%1 = alloca %struct.ct_path*
%2 = alloca %struct.ct_path*
%3 = alloca %struct.ct_path*
%4 = call %struct.ct_path* @ct_path_alloc(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
store %struct.ct_path* %4, %struct.ct_path** %1
%5 = call %struct.ct_path* @ct_path_alloc(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
store %struct.ct_path* %5, %struct.ct_path** %2
%6 = call %struct.ct_path* @ct_path_alloc(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
store %struct.ct_path* %6, %struct.ct_path** %3
%7 = load %struct.ct_path*, %struct.ct_path** %1
%8 = load %struct.ct_path*, %struct.ct_path** %1
%9 = call i32 @ct_path_equals_path(%struct.ct_path* %7, %struct.ct_path* %8)
%10 = call i32 @assert(i32 %9)
%11 = load %struct.ct_path*, %struct.ct_path** %2
%12 = load %struct.ct_path*, %struct.ct_path** %2
%13 = call i32 @ct_path_equals_path(%struct.ct_path* %11, %struct.ct_path* %12)
%14 = call i32 @assert(i32 %13)
%15 = load %struct.ct_path*, %struct.ct_path** %1
%16 = load %struct.ct_path*, %struct.ct_path** %2
%17 = call i32 @ct_path_equals_path(%struct.ct_path* %15, %struct.ct_path* %16)
%18 = call i32 @assert(i32 %17)
%19 = load %struct.ct_path*, %struct.ct_path** %2
%20 = load %struct.ct_path*, %struct.ct_path** %1
%21 = call i32 @ct_path_equals_path(%struct.ct_path* %19, %struct.ct_path* %20)
%22 = call i32 @assert(i32 %21)
%23 = load %struct.ct_path*, %struct.ct_path** %1
%24 = load %struct.ct_path*, %struct.ct_path** %3
%25 = call i32 @ct_path_equals_path(%struct.ct_path* %23, %struct.ct_path* %24)
%26 = icmp ne i32 %25, 0
%27 = xor i1 %26, true
%28 = zext i1 %27 to i32
%29 = call i32 @assert(i32 %28)
%30 = load %struct.ct_path*, %struct.ct_path** %3
%31 = load %struct.ct_path*, %struct.ct_path** %1
%32 = call i32 @ct_path_equals_path(%struct.ct_path* %30, %struct.ct_path* %31)
%33 = icmp ne i32 %32, 0
%34 = xor i1 %33, true
%35 = zext i1 %34 to i32
%36 = call i32 @assert(i32 %35)
%37 = load %struct.ct_path*, %struct.ct_path** %3
%38 = call i32 @ct_path_free(%struct.ct_path* %37)
%39 = load %struct.ct_path*, %struct.ct_path** %2
%40 = call i32 @ct_path_free(%struct.ct_path* %39)
%41 = load %struct.ct_path*, %struct.ct_path** %1
%42 = call i32 @ct_path_free(%struct.ct_path* %41)
ret void
}

LLVM IR (-O2):
%struct.ct_path = type { i32 }
@.str = [5 x i8] c"/tmp\00"
@.str.1 = [4 x i8] c"foo\00"
@.str.2 = [5 x i8] c"/var\00"
@.str.3 = [9 x i8] c"/tmp/foo\00"
@.str.4 = [4 x i8] c"bar\00"
define void @test_path_equals_path() {
%1 = tail call %struct.ct_path* @ct_path_alloc(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call %struct.ct_path* @ct_path_alloc(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
%3 = tail call %struct.ct_path* @ct_path_alloc(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%4 = tail call i32 @ct_path_equals_path(%struct.ct_path* %1, %struct.ct_path* %1)
%5 = tail call i32 @assert(i32 %4)
%6 = tail call i32 @ct_path_equals_path(%struct.ct_path* %2, %struct.ct_path* %2)
%7 = tail call i32 @assert(i32 %6)
%8 = tail call i32 @ct_path_equals_path(%struct.ct_path* %1, %struct.ct_path* %2)
%9 = tail call i32 @assert(i32 %8)
%10 = tail call i32 @ct_path_equals_path(%struct.ct_path* %2, %struct.ct_path* %1)
%11 = tail call i32 @assert(i32 %10)
%12 = tail call i32 @ct_path_equals_path(%struct.ct_path* %1, %struct.ct_path* %3)
%13 = icmp eq i32 %12, 0
%14 = zext i1 %13 to i32
%15 = tail call i32 @assert(i32 %14)
%16 = tail call i32 @ct_path_equals_path(%struct.ct_path* %3, %struct.ct_path* %1)
%17 = icmp eq i32 %16, 0
%18 = zext i1 %17 to i32
%19 = tail call i32 @assert(i32 %18)
%20 = tail call i32 @ct_path_free(%struct.ct_path* %3)
%21 = tail call i32 @ct_path_free(%struct.ct_path* %2)
%22 = tail call i32 @ct_path_free(%struct.ct_path* %1)
ret void
}