#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 */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
typedef int /*<<< orphan*/ timer_t;
struct timespec {
  scalar_t__ tv_sec;
  int tv_nsec;
};
struct sigevent {
  int /*<<< orphan*/ sigev_signo;
  int /*<<< orphan*/ sigev_notify;
};
struct TYPE_4__ {
  int tv_sec;
  scalar_t__ tv_nsec;
};
struct TYPE_3__ {
  int tv_nsec;
  scalar_t__ tv_sec;
};
struct itimerspec {
  TYPE_2__ it_value;
  TYPE_1__ it_interval;
};
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int /*<<< orphan*/ CLOCK_REALTIME;
int /*<<< orphan*/ SIGCONT;
int /*<<< orphan*/ SIGEV_SIGNAL;
int /*<<< orphan*/ SIG_SETMASK;
int /*<<< orphan*/ SIG_UNBLOCK;
scalar_t__ clock_getres(int /*<<< orphan*/, struct timespec *);
scalar_t__ nanosleep(struct timespec *, int /*<<< orphan*/ *);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ sigaddset(int /*<<< orphan*/ *, int /*<<< orphan*/);
scalar_t__ sigemptyset(int /*<<< orphan*/ *);
scalar_t__ sigprocmask(int /*<<< orphan*/, int /*<<< orphan*/ *,
                       int /*<<< orphan*/ *);
scalar_t__ timer_create(int /*<<< orphan*/, struct sigevent *,
                        int /*<<< orphan*/ *);
int timer_getoverrun(int /*<<< orphan*/);
scalar_t__ timer_settime(int /*<<< orphan*/, int /*<<< orphan*/,
                         struct itimerspec *, int /*<<< orphan*/ *);
int main(void) {
  printf("_POSIX_REALTIME_SIGNALS is not defined\n");
  return 5;
  sigset_t set;
  struct sigevent ev;
  timer_t tid;
  struct itimerspec its;
  struct timespec tssleep, tsres;
  int overruns;
  int valuensec, intervalnsec, expectedoverruns;
  int fudge;
  if (sigemptyset(&set) != 0) {
    perror("sigemptyset() did not return success\n");
    return 2;
  }
  if (sigaddset(&set, SIGCONT) != 0) {
    perror("sigaddset() did not return success\n");
    return 2;
  }
  if (sigprocmask(SIG_SETMASK, &set, NULL) != 0) {
    perror("sigprocmask() did not return success\n");
    return 2;
  }
  ev.sigev_notify = SIGEV_SIGNAL;
  ev.sigev_signo = SIGCONT;
  if (timer_create(CLOCK_REALTIME, &ev, &tid) != 0) {
    perror("timer_create() did not return success\n");
    return 2;
  }
  if (clock_getres(CLOCK_REALTIME, &tsres) != 0) {
    perror("clock_gettime() did not return success\n");
    return 2;
  }
  if (tsres.tv_sec != 0) {
    printf("Clock resolution in seconds, not nsecs.  Exiting.\n");
    return 2;
  }
  valuensec = tsres.tv_nsec;
  intervalnsec = 2 * valuensec;
  expectedoverruns = 1000000000 / intervalnsec - 1;
  fudge = 50000000 / intervalnsec + 1;
  printf("value = %d sec, interval = %d nsec, "
         "expected overruns = %d, fudge = %d\n",
         1, intervalnsec, expectedoverruns, fudge);
  its.it_interval.tv_sec = 0;
  its.it_interval.tv_nsec = intervalnsec;
  its.it_value.tv_sec = 1;
  its.it_value.tv_nsec = 0;
  if (timer_settime(tid, 0, &its, NULL) != 0) {
    perror("timer_settime() did not return success\n");
    return 2;
  }
  tssleep.tv_nsec = 0;
  tssleep.tv_sec = 2;
  if (nanosleep(&tssleep, NULL) != 0) {
    perror("nanosleep() did not return success\n");
    return 2;
  }
  if (sigprocmask(SIG_UNBLOCK, &set, NULL) != 0) {
    perror("sigprocmask() did not return success\n");
    return 2;
  }
  overruns = timer_getoverrun(tid);
  printf("%d overruns occurred\n", overruns);
  if (overruns >= expectedoverruns && overruns < expectedoverruns + fudge) {
    printf("Test PASSED\n");
    return 0;
  }
  printf("FAIL:  %d overruns sent; expected %d\n", overruns, expectedoverruns);
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x5,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x5,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.sigevent = type { i32, i32 }
%struct.itimerspec = type { %struct.TYPE_4__, %struct.TYPE_3__ }
%struct.TYPE_4__ = type { i32, i64 }
%struct.TYPE_3__ = type { i32, i64 }
%struct.timespec = type { i64, i32 }
@.str = [40 x i8] c"_POSIX_REALTIME_SIGNALS is not defined\0A\00"
@CLOCK_REALTIME = global i32 0
@SIGCONT = global i32 0
@SIGEV_SIGNAL = global i32 0
@SIG_SETMASK = global i32 0
@SIG_UNBLOCK = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca %struct.sigevent
%4 = alloca i32
%5 = alloca %struct.itimerspec
%6 = alloca %struct.timespec
%7 = alloca %struct.timespec
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32 0, i32* %1
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
ret i32 5
}

LLVM IR (-O2):
@CLOCK_REALTIME = global i32 0
@SIGCONT = global i32 0
@SIGEV_SIGNAL = global i32 0
@SIG_SETMASK = global i32 0
@SIG_UNBLOCK = global i32 0
@str = [39 x i8] c"_POSIX_REALTIME_SIGNALS is not defined\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
ret i32 5
}