#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*/ pthread_barrierattr_t;

/* Variables and functions */
int PTHREAD_PROCESS_PRIVATE;
int PTHREAD_PROCESS_SHARED;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ pthread_barrierattr_getpshared(int /*<<< orphan*/ *, int *);
scalar_t__ pthread_barrierattr_init(int /*<<< orphan*/ *);
int pthread_barrierattr_setpshared(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ stderr;
int main(void) {
  fprintf(stderr, "process-shared attribute is not available for testing\n");
  return 4;
  pthread_barrierattr_t ba;
  int pshared = PTHREAD_PROCESS_SHARED;
  int pshared2 = PTHREAD_PROCESS_PRIVATE;
  int rc;
  if (pthread_barrierattr_init(&ba) != 0) {
    printf("Error at pthread_barrierattr_init()\n");
    return 2;
  }
  rc = pthread_barrierattr_setpshared(&ba, pshared);
  if (rc != 0) {
    printf("Test FAILED: Error at pthread_barrierattr_setpshared()\n");
    return 1;
  }
  if (pthread_barrierattr_getpshared(&ba, &pshared) != 0) {
    printf("Error at pthread_barrierattr_getpshared()\n");
    return 1;
  }
  if (pshared != PTHREAD_PROCESS_SHARED) {
    printf("Test FAILED: Got error shared attribute value %d\n", pshared);
    return 1;
  }
  rc = pthread_barrierattr_setpshared(&ba, pshared2);
  if (rc != 0) {
    printf("Test FAILED: Error at pthread_barrierattr_setpshared()\n");
    return 1;
  }
  if (pthread_barrierattr_getpshared(&ba, &pshared2) != 0) {
    printf("Error at pthread_barrierattr_getpshared()\n");
    return 1;
  }
  if (pshared2 != PTHREAD_PROCESS_PRIVATE) {
    printf("Test FAILED: Got error shared attribute value %d\n", pshared);
    return 1;
  }
  printf("Test PASSED\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
lea    0xed1(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x4,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x4,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [55 x i8] c"process-shared attribute is not available for testing\0A\00"
@PTHREAD_PROCESS_PRIVATE = global i32 0
@PTHREAD_PROCESS_SHARED = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = load i32, i32* @stderr
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
ret i32 4
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [55 x i8] c"process-shared attribute is not available for testing\0A\00"
@PTHREAD_PROCESS_PRIVATE = global i32 0
@PTHREAD_PROCESS_SHARED = global i32 0
define i32 @main() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
ret i32 4
}