#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 stat {
  scalar_t__ st_dev;
  scalar_t__ st_ino;
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
scalar_t__ S_ISDIR(int /*<<< orphan*/);
scalar_t__ stat(char *, struct stat *);
int main(int argc, char **argv) {
  struct stat stbuf1, stbuf2;
  if (argc == 3 && stat(argv[1], &stbuf1) == 0 && stat(argv[2], &stbuf2) == 0 &&
      S_ISDIR(stbuf1.st_mode) &&
      (stbuf1.st_dev != stbuf2.st_dev || stbuf1.st_ino != stbuf2.st_ino)) {
    return 0;
  } else {
    return 1;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
jne    11b0 <main+0x90>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    -0x28(%rbp),%rsi
call   1040 <stat@plt>
cmp    $0x0,%rax
jne    11b0 <main+0x90>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    -0x40(%rbp),%rsi
call   1040 <stat@plt>
cmp    $0x0,%rax
jne    11b0 <main+0x90>
mov    -0x18(%rbp),%edi
call   1030 <S_ISDIR@plt>
cmp    $0x0,%rax
je     11b0 <main+0x90>
mov    -0x28(%rbp),%rax
cmp    -0x40(%rbp),%rax
jne    11a4 <main+0x84>
mov    -0x20(%rbp),%rax
cmp    -0x38(%rbp),%rax
je     11b0 <main+0x90>
movl   $0x0,-0x4(%rbp)
jmp    11b7 <main+0x97>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
cmp    $0x3,%edi
jne    1151 <main+0x31>
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
mov    %rsp,%rsi
call   1040 <stat@plt>
test   %rax,%rax
jne    1151 <main+0x31>
mov    0x10(%rbx),%rdi
lea    0x18(%rsp),%rsi
call   1040 <stat@plt>
test   %rax,%rax
je     115c <main+0x3c>
mov    $0x1,%eax
add    $0x30,%rsp
pop    %rbx
ret
mov    0x10(%rsp),%edi
call   1030 <S_ISDIR@plt>
test   %rax,%rax
je     1151 <main+0x31>
mov    (%rsp),%rcx
xor    %eax,%eax
cmp    0x18(%rsp),%rcx
jne    1156 <main+0x36>
mov    0x8(%rsp),%rcx
cmp    0x20(%rsp),%rcx
je     1151 <main+0x31>
jmp    1156 <main+0x36>

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

LLVM IR (-O2):
%struct.stat = type { i64, i64, i32 }
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca %struct.stat
%4 = alloca %struct.stat
%5 = bitcast %struct.stat* %3 to i8*
%6 = bitcast %struct.stat* %4 to i8*
%7 = icmp eq i32 %0, 3
br i1 %7, label %8, label %35
8: ; preds = %2
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = call i64 @stat(i8* %10, %struct.stat* %3)
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %35
13: ; preds = %8
%14 = getelementptr inbounds i8*, i8** %1, i64 2
%15 = load i8*, i8** %14
%16 = call i64 @stat(i8* %15, %struct.stat* %4)
%17 = icmp eq i64 %16, 0
br i1 %17, label %18, label %35
18: ; preds = %13
%19 = getelementptr inbounds %struct.stat, %struct.stat* %3, i64 0, i32 2
%20 = load i32, i32* %19
%21 = call i64 @S_ISDIR(i32 %20)
%22 = icmp eq i64 %21, 0
br i1 %22, label %35, label %23
23: ; preds = %18
%24 = getelementptr inbounds %struct.stat, %struct.stat* %3, i64 0, i32 0
%25 = load i64, i64* %24
%26 = getelementptr inbounds %struct.stat, %struct.stat* %4, i64 0, i32 0
%27 = load i64, i64* %26
%28 = icmp eq i64 %25, %27
br i1 %28, label %29, label %36
29: ; preds = %23
%30 = getelementptr inbounds %struct.stat, %struct.stat* %3, i64 0, i32 1
%31 = load i64, i64* %30
%32 = getelementptr inbounds %struct.stat, %struct.stat* %4, i64 0, i32 1
%33 = load i64, i64* %32
%34 = icmp eq i64 %31, %33
br i1 %34, label %35, label %36
35: ; preds = %29, %18, %13, %8, %2
br label %36
36: ; preds = %23, %29, %35
%37 = phi i32 [ 1, %35 ], [ 0, %29 ], [ 0, %23 ]
ret i32 %37
}