#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 */
typedef int /*<<< orphan*/ t_can;
typedef int /*<<< orphan*/ s_can;

/* Variables and functions */
int /*<<< orphan*/ canonicalize_path(char const *, char *, int);
int /*<<< orphan*/ strlen(char const *);
scalar_t__ stroscmp(char *, char *);
int paths_are_equal(const char s[], const char t[]) {
  char s_can[strlen(s) + 8];
  char t_can[strlen(t) + 8];
  canonicalize_path(s, s_can, sizeof(s_can));
  canonicalize_path(t, t_can, sizeof(t_can));
  return stroscmp(s_can, t_can) == 0;
}


x86 assembly (clang, -O0):
<paths_are_equal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x8,%eax
mov    %rax,-0x48(%rbp)
mov    %rsp,%rcx
mov    %rcx,-0x18(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x38(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x38(%rbp),%rsi
mov    %eax,%ecx
mov    -0x48(%rbp),%rax
add    $0x8,%ecx
mov    %rcx,-0x40(%rbp)
mov    %rcx,%rdi
add    $0xf,%rdi
and    $0xfffffffffffffff0,%rdi
mov    %rsp,%rdx
sub    %rdi,%rdx
mov    %rdx,-0x30(%rbp)
mov    %rdx,%rsp
mov    %rcx,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    %eax,%edx
call   1050 <canonicalize_path@plt>
mov    -0x30(%rbp),%rsi
mov    -0x40(%rbp),%rax
mov    -0x10(%rbp),%rdi
mov    %eax,%edx
call   1050 <canonicalize_path@plt>
mov    -0x38(%rbp),%rdi
mov    -0x30(%rbp),%rsi
call   1040 <stroscmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    -0x18(%rbp),%rcx
mov    %rcx,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<paths_are_equal>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rsi,-0x30(%rbp)
mov    %rdi,%r15
call   1030 <strlen@plt>
lea    0x8(%rax),%r12d
mov    %rsp,%rbx
lea    0xf(%r12),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
mov    %r14,%rdi
call   1030 <strlen@plt>
lea    0x8(%rax),%r13d
mov    %rsp,%r14
lea    0xf(%r13),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r14
mov    %r14,%rsp
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %r12d,%edx
call   1050 <canonicalize_path@plt>
mov    -0x30(%rbp),%rdi
mov    %r14,%rsi
mov    %r13d,%edx
call   1050 <canonicalize_path@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <stroscmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @paths_are_equal(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
store i8* %0, i8** %3
store i8* %1, i8** %4
%8 = load i8*, i8** %3
%9 = call i32 @strlen(i8* %8)
%10 = add nsw i32 %9, 8
%11 = zext i32 %10 to i64
%12 = call i8* @llvm.stacksave()
store i8* %12, i8** %5
%13 = alloca i8, i64 %11
store i64 %11, i64* %6
%14 = load i8*, i8** %4
%15 = call i32 @strlen(i8* %14)
%16 = add nsw i32 %15, 8
%17 = zext i32 %16 to i64
%18 = alloca i8, i64 %17
store i64 %17, i64* %7
%19 = load i8*, i8** %3
%20 = trunc i64 %11 to i32
%21 = call i32 @canonicalize_path(i8* %19, i8* %13, i32 %20)
%22 = load i8*, i8** %4
%23 = trunc i64 %17 to i32
%24 = call i32 @canonicalize_path(i8* %22, i8* %18, i32 %23)
%25 = call i64 @stroscmp(i8* %13, i8* %18)
%26 = icmp eq i64 %25, 0
%27 = zext i1 %26 to i32
%28 = load i8*, i8** %5
ret i32 %27
}

LLVM IR (-O2):
define i32 @paths_are_equal(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = add nsw i32 %3, 8
%5 = zext i32 %4 to i64
%6 = alloca i8, i64 %5
%7 = tail call i32 @strlen(i8* %1)
%8 = add nsw i32 %7, 8
%9 = zext i32 %8 to i64
%10 = alloca i8, i64 %9
%11 = call i32 @canonicalize_path(i8* %0, i8* %6, i32 %4)
%12 = call i32 @canonicalize_path(i8* %1, i8* %10, i32 %8)
%13 = call i64 @stroscmp(i8* %6, i8* %10)
%14 = icmp eq i64 %13, 0
%15 = zext i1 %14 to i32
ret i32 %15
}