#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*/ XATTR_REPLACE;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int setxattr(char *, char *, char *, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
void set_disconnect(void) {
  int result;
  result = setxattr(".", "tsumufs.force-disconnect", "1", strlen("1"),
                    XATTR_REPLACE);
  if (result < 0) {
    perror("Unable to set force-disconnect.");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<set_disconnect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xeca(%rip),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    0x2e83(%rip),%rax
mov    (%rax),%r8d
lea    0xed2(%rip),%rdi
lea    0xe92(%rip),%rsi
lea    0xea4(%rip),%rdx
call   1060 <setxattr@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    119d <set_disconnect+0x5d>
lea    0xe8d(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_disconnect>:
push   %rbx
lea    0xed1(%rip),%rbx
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    0x2e89(%rip),%rcx
mov    (%rcx),%r8d
lea    0xed8(%rip),%rdi
lea    0xe98(%rip),%rsi
mov    %rbx,%rdx
mov    %eax,%ecx
call   1060 <setxattr@plt>
test   %eax,%eax
js     1178 <set_disconnect+0x38>
pop    %rbx
ret
lea    0xe9c(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [2 x i8] c".\00"
@.str.1 = [25 x i8] c"tsumufs.force-disconnect\00"
@.str.2 = [2 x i8] c"1\00"
@XATTR_REPLACE = global i32 0
@.str.3 = [32 x i8] c"Unable to set force-disconnect.\00"
define void @set_disconnect() {
%1 = alloca i32
%2 = call i32 @strlen(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%3 = load i32, i32* @XATTR_REPLACE
%4 = call i32 @setxattr(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i32 %2, i32 %3)
store i32 %4, i32* %1
%5 = load i32, i32* %1
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %0
%8 = call i32 @perror(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0))
%9 = call i32 @exit(i32 1)
unreachable
10: ; preds = %0
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c".\00"
@.str.1 = [25 x i8] c"tsumufs.force-disconnect\00"
@.str.2 = [2 x i8] c"1\00"
@XATTR_REPLACE = global i32 0
@.str.3 = [32 x i8] c"Unable to set force-disconnect.\00"
define void @set_disconnect() {
%1 = tail call i32 @strlen(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%2 = load i32, i32* @XATTR_REPLACE
%3 = tail call i32 @setxattr(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i32 %1, i32 %2)
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = tail call i32 @perror(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %0
ret void
}