#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 pause_sync(void) {
  int result;
  result = setxattr(".", "tsumufs.pause-sync", "1", strlen("1"), XATTR_REPLACE);
  if (result < 0) {
    perror("Unable to set pause-sync.");
    exit(1);
  }
}


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

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

LLVM IR (-O0):
@.str = [2 x i8] c".\00"
@.str.1 = [19 x i8] c"tsumufs.pause-sync\00"
@.str.2 = [2 x i8] c"1\00"
@XATTR_REPLACE = global i32 0
@.str.3 = [26 x i8] c"Unable to set pause-sync.\00"
define void @pause_sync() {
%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 ([19 x i8], [19 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 ([26 x i8], [26 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 = [19 x i8] c"tsumufs.pause-sync\00"
@.str.2 = [2 x i8] c"1\00"
@XATTR_REPLACE = global i32 0
@.str.3 = [26 x i8] c"Unable to set pause-sync.\00"
define void @pause_sync() {
%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 ([19 x i8], [19 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 ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %0
ret void
}