#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 timespec {
  scalar_t__ tv_sec;
};
typedef scalar_t__ pid_t;
typedef int /*<<< orphan*/ now_str;

/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC;
int /*<<< orphan*/ _gettime(int /*<<< orphan*/, struct timespec *, int);
scalar_t__ _settime(int /*<<< orphan*/, int);
int abs(scalar_t__);
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
int /*<<< orphan*/ execve(char *, char **, char **);
scalar_t__ fork();
int /*<<< orphan*/ ksft_exit_fail();
int /*<<< orphan*/ ksft_exit_pass();
int /*<<< orphan*/ ksft_set_plan(int);
int /*<<< orphan*/ ksft_test_result_error(char *);
int /*<<< orphan*/ ksft_test_result_fail(char *, scalar_t__, scalar_t__);
int /*<<< orphan*/ ksft_test_result_pass(char *);
int /*<<< orphan*/ nscheck();
int /*<<< orphan*/ snprintf(char *, int, char *, scalar_t__);
int sscanf(char *, char *, scalar_t__ *);
scalar_t__ unshare_timens();
scalar_t__ waitpid(scalar_t__, int *, int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  struct timespec now, tst;
  int status, i;
  pid_t pid;
  if (argc > 1) {
    if (sscanf(argv[1], "%ld", &now.tv_sec) != 1)
      return ({
        ksft_test_result_error("sscanf"
                               ": %m"
                               "\n");
        -1;
      });
    for (i = 0; i < 2; i++) {
      _gettime(CLOCK_MONOTONIC, &tst, i);
      if (abs(tst.tv_sec - now.tv_sec) > 5)
        return ({
          ksft_test_result_fail("%ld %ld\n", now.tv_sec, tst.tv_sec);
          -1;
        });
    }
    return 0;
  }
  nscheck();
  ksft_set_plan(1);
  clock_gettime(CLOCK_MONOTONIC, &now);
  if (unshare_timens())
    return 1;
  if (_settime(CLOCK_MONOTONIC, (36000)))
    return 1;
  for (i = 0; i < 2; i++) {
    _gettime(CLOCK_MONOTONIC, &tst, i);
    if (abs(tst.tv_sec - now.tv_sec) > 5)
      return ({
        ksft_test_result_fail("%ld %ld\n", now.tv_sec, tst.tv_sec);
        -1;
      });
  }
  if (argc > 1)
    return 0;
  pid = fork();
  if (pid < 0)
    return ({
      ksft_test_result_error("fork"
                             ": %m"
                             "\n");
      -1;
    });
  if (pid == 0) {
    char now_str[64];
    char *cargv[] = {"exec", now_str, NULL};
    char *cenv[] = {NULL};
    for (i = 0; i < 2; i++) {
      _gettime(CLOCK_MONOTONIC, &tst, i);
      if (abs(tst.tv_sec - now.tv_sec - (36000)) > 5)
        return ({
          ksft_test_result_fail("%ld %ld\n", now.tv_sec + (36000), tst.tv_sec);
          -1;
        });
    }
    snprintf(now_str, sizeof(now_str), "%ld", now.tv_sec + (36000));
    execve("/proc/self/exe", cargv, cenv);
    return ({
      ksft_test_result_error("execve"
                             ": %m"
                             "\n");
      -1;
    });
  }
  if (waitpid(pid, &status, 0) != pid)
    return ({
      ksft_test_result_error("waitpid"
                             ": %m"
                             "\n");
      -1;
    });
  if (status)
    ksft_exit_fail();
  ksft_test_result_pass("exec\n");
  ksft_exit_pass();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    1303 <main+0xe3>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    -0x18(%rbp),%rdx
lea    0xdaa(%rip),%rsi
call   10f0 <sscanf@plt>
cmp    $0x1,%eax
je     1282 <main+0x62>
lea    0xd99(%rip),%rdi
call   10c0 <ksft_test_result_error@plt>
movl   $0xffffffff,-0x34(%rbp)
mov    -0x34(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    15bc <main+0x39c>
movl   $0x0,-0x28(%rbp)
cmpl   $0x2,-0x28(%rbp)
jge    12f7 <main+0xd7>
mov    0x2d4e(%rip),%rax
mov    (%rax),%edi
mov    -0x28(%rbp),%edx
lea    -0x20(%rbp),%rsi
call   1030 <_gettime@plt>
mov    -0x20(%rbp),%rdi
sub    -0x18(%rbp),%rdi
call   1050 <abs@plt>
cmp    $0x5,%eax
jle    12e4 <main+0xc4>
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
lea    0xd43(%rip),%rdi
call   10e0 <ksft_test_result_fail@plt>
movl   $0xffffffff,-0x38(%rbp)
mov    -0x38(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    15bc <main+0x39c>
jmp    12e9 <main+0xc9>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1289 <main+0x69>
movl   $0x0,-0x4(%rbp)
jmp    15bc <main+0x39c>
mov    $0x0,%al
call   1100 <nscheck@plt>
mov    $0x1,%edi
call   1070 <ksft_set_plan@plt>
mov    0x2ccd(%rip),%rax
mov    (%rax),%edi
lea    -0x18(%rbp),%rsi
call   1060 <clock_gettime@plt>
mov    $0x0,%al
call   1130 <unshare_timens@plt>
cmp    $0x0,%rax
je     1343 <main+0x123>
movl   $0x1,-0x4(%rbp)
jmp    15bc <main+0x39c>
mov    0x2c9e(%rip),%rax
mov    (%rax),%edi
mov    $0x8ca0,%esi
call   1120 <_settime@plt>
cmp    $0x0,%rax
je     136c <main+0x14c>
movl   $0x1,-0x4(%rbp)
jmp    15bc <main+0x39c>
movl   $0x0,-0x28(%rbp)
cmpl   $0x2,-0x28(%rbp)
jge    13e1 <main+0x1c1>
mov    0x2c64(%rip),%rax
mov    (%rax),%edi
mov    -0x28(%rbp),%edx
lea    -0x20(%rbp),%rsi
call   1030 <_gettime@plt>
mov    -0x20(%rbp),%rdi
sub    -0x18(%rbp),%rdi
call   1050 <abs@plt>
cmp    $0x5,%eax
jle    13ce <main+0x1ae>
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
lea    0xc59(%rip),%rdi
call   10e0 <ksft_test_result_fail@plt>
movl   $0xffffffff,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    15bc <main+0x39c>
jmp    13d3 <main+0x1b3>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1373 <main+0x153>
cmpl   $0x1,-0x8(%rbp)
jle    13f7 <main+0x1d7>
movl   $0x0,-0x4(%rbp)
jmp    15bc <main+0x39c>
mov    $0x0,%al
call   1140 <fork@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
jge    142b <main+0x20b>
lea    0xc05(%rip),%rdi
call   10c0 <ksft_test_result_error@plt>
movl   $0xffffffff,-0x40(%rbp)
mov    -0x40(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    15bc <main+0x39c>
cmpq   $0x0,-0x30(%rbp)
jne    1554 <main+0x334>
lea    0xbe6(%rip),%rax
mov    %rax,-0xa0(%rbp)
lea    -0x80(%rbp),%rax
mov    %rax,-0x98(%rbp)
movq   $0x0,-0x90(%rbp)
lea    -0xa8(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   10b0 <memset@plt>
movl   $0x0,-0x28(%rbp)
cmpl   $0x2,-0x28(%rbp)
jge    14f6 <main+0x2d6>
mov    0x2b63(%rip),%rax
mov    (%rax),%edi
mov    -0x28(%rbp),%edx
lea    -0x20(%rbp),%rsi
call   1030 <_gettime@plt>
mov    -0x20(%rbp),%rdi
sub    -0x18(%rbp),%rdi
sub    $0x8ca0,%rdi
call   1050 <abs@plt>
cmp    $0x5,%eax
jle    14e3 <main+0x2c3>
mov    -0x18(%rbp),%rsi
add    $0x8ca0,%rsi
mov    -0x20(%rbp),%rdx
lea    0xb4a(%rip),%rdi
call   10e0 <ksft_test_result_fail@plt>
movl   $0xffffffff,-0xac(%rbp)
ff ff ff
mov    -0xac(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    15bc <main+0x39c>
jmp    14e8 <main+0x2c8>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1474 <main+0x254>
lea    -0x80(%rbp),%rdi
mov    -0x18(%rbp),%rcx
add    $0x8ca0,%rcx
mov    $0x40,%esi
lea    0xaef(%rip),%rdx
call   10a0 <snprintf@plt>
lea    -0xa0(%rbp),%rsi
lea    -0xa8(%rbp),%rdx
lea    0xafd(%rip),%rdi
call   10d0 <execve@plt>
lea    0xb00(%rip),%rdi
call   10c0 <ksft_test_result_error@plt>
movl   $0xffffffff,-0xb0(%rbp)
ff ff ff
mov    -0xb0(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    15bc <main+0x39c>
mov    -0x30(%rbp),%rdi
lea    -0x24(%rbp),%rsi
xor    %edx,%edx
call   1110 <waitpid@plt>
cmp    -0x30(%rbp),%rax
je     1591 <main+0x371>
lea    0xacf(%rip),%rdi
call   10c0 <ksft_test_result_error@plt>
movl   $0xffffffff,-0xb4(%rbp)
ff ff ff
mov    -0xb4(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    15bc <main+0x39c>
cmpl   $0x0,-0x24(%rbp)
je     15a2 <main+0x382>
mov    $0x0,%al
call   1090 <ksft_exit_fail@plt>
lea    0xaa7(%rip),%rdi
call   1040 <ksft_test_result_pass@plt>
mov    $0x0,%al
call   1080 <ksft_exit_pass@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x88,%rsp
cmp    $0x2,%edi
jl     129c <main+0x8c>
mov    0x8(%rsi),%rdi
lea    0xdd6(%rip),%rsi
lea    0x10(%rsp),%rdx
call   10e0 <sscanf@plt>
cmp    $0x1,%eax
jne    1349 <main+0x139>
mov    0x2da4(%rip),%r14
mov    (%r14),%edi
lea    0x8(%rsp),%rsi
xor    %ebx,%ebx
xor    %edx,%edx
call   1030 <_gettime@plt>
mov    0x8(%rsp),%rdi
sub    0x10(%rsp),%rdi
call   1050 <abs@plt>
cmp    $0x5,%eax
jg     1331 <main+0x121>
mov    (%r14),%edi
lea    0x8(%rsp),%rsi
mov    $0x1,%edx
call   1030 <_gettime@plt>
mov    0x8(%rsp),%rdi
sub    0x10(%rsp),%rdi
call   1050 <abs@plt>
cmp    $0x6,%eax
jge    1331 <main+0x121>
jmp    135a <main+0x14a>
xor    %eax,%eax
call   10f0 <nscheck@plt>
mov    $0x1,%ebx
mov    $0x1,%edi
call   1070 <ksft_set_plan@plt>
mov    0x2d2f(%rip),%r14
mov    (%r14),%edi
lea    0x10(%rsp),%rsi
call   1060 <clock_gettime@plt>
xor    %eax,%eax
call   1120 <unshare_timens@plt>
test   %rax,%rax
jne    135a <main+0x14a>
mov    (%r14),%edi
mov    $0x8ca0,%esi
call   1110 <_settime@plt>
test   %rax,%rax
jne    135a <main+0x14a>
mov    (%r14),%edi
lea    0x8(%rsp),%rsi
xor    %edx,%edx
call   1030 <_gettime@plt>
mov    0x8(%rsp),%rdi
sub    0x10(%rsp),%rdi
call   1050 <abs@plt>
cmp    $0x5,%eax
jg     1331 <main+0x121>
mov    (%r14),%edi
lea    0x8(%rsp),%rsi
mov    $0x1,%edx
call   1030 <_gettime@plt>
mov    0x8(%rsp),%rdi
sub    0x10(%rsp),%rdi
call   1050 <abs@plt>
cmp    $0x5,%eax
jle    1367 <main+0x157>
mov    0x10(%rsp),%rsi
mov    0x8(%rsp),%rdx
lea    0xcce(%rip),%rdi
call   10d0 <ksft_test_result_fail@plt>
jmp    1355 <main+0x145>
lea    0xcb4(%rip),%rdi
call   10b0 <ksft_test_result_error@plt>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
add    $0x88,%rsp
pop    %rbx
pop    %r14
ret
xor    %eax,%eax
call   1130 <fork@plt>
test   %rax,%rax
js     13b5 <main+0x1a5>
je     13be <main+0x1ae>
mov    %rax,%rbx
lea    0x40(%rsp),%rsi
mov    %rax,%rdi
xor    %edx,%edx
call   1100 <waitpid@plt>
cmp    %rbx,%rax
jne    144c <main+0x23c>
cmpl   $0x0,0x40(%rsp)
je     139e <main+0x18e>
xor    %eax,%eax
call   1090 <ksft_exit_fail@plt>
lea    0xcab(%rip),%rdi
call   1040 <ksft_test_result_pass@plt>
xor    %ebx,%ebx
xor    %eax,%eax
call   1080 <ksft_exit_pass@plt>
jmp    135a <main+0x14a>
lea    0xc5d(%rip),%rdi
jmp    1350 <main+0x140>
lea    0xc5e(%rip),%rax
mov    %rax,0x20(%rsp)
lea    0x40(%rsp),%rax
mov    %rax,0x28(%rsp)
movq   $0x0,0x30(%rsp)
movq   $0x0,0x18(%rsp)
mov    (%r14),%edi
lea    0x8(%rsp),%rsi
xor    %edx,%edx
call   1030 <_gettime@plt>
mov    0x8(%rsp),%rdi
sub    0x10(%rsp),%rdi
add    $0xffffffffffff7360,%rdi
call   1050 <abs@plt>
cmp    $0x5,%eax
jg     143d <main+0x22d>
mov    (%r14),%edi
lea    0x8(%rsp),%rsi
mov    $0x1,%edx
call   1030 <_gettime@plt>
mov    0x8(%rsp),%rdi
sub    0x10(%rsp),%rdi
add    $0xffffffffffff7360,%rdi
call   1050 <abs@plt>
cmp    $0x5,%eax
jle    1458 <main+0x248>
mov    $0x8ca0,%esi
add    0x10(%rsp),%rsi
jmp    1336 <main+0x126>
lea    0xbf0(%rip),%rdi
jmp    1350 <main+0x140>
mov    $0x8ca0,%ecx
add    0x10(%rsp),%rcx
lea    0xb97(%rip),%rdx
lea    0x40(%rsp),%rdi
mov    $0x40,%esi
call   10a0 <snprintf@plt>
lea    0xba9(%rip),%rdi
lea    0x20(%rsp),%rsi
lea    0x18(%rsp),%rdx
call   10c0 <execve@plt>
lea    0xba2(%rip),%rdi
jmp    1350 <main+0x140>

LLVM IR (-O0):
%struct.timespec = type { i64 }
@.str = [4 x i8] c"%ld\00"
@.str.1 = [12 x i8] c"sscanf: %m\0A\00"
@CLOCK_MONOTONIC = global i32 0
@.str.2 = [9 x i8] c"%ld %ld\0A\00"
@.str.3 = [10 x i8] c"fork: %m\0A\00"
@.str.4 = [5 x i8] c"exec\00"
@.str.5 = [15 x i8] c"/proc/self/exe\00"
@.str.6 = [12 x i8] c"execve: %m\0A\00"
@.str.7 = [13 x i8] c"waitpid: %m\0A\00"
@.str.8 = [6 x i8] c"exec\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.timespec
%7 = alloca %struct.timespec
%8 = alloca i32
%9 = alloca i32
%10 = alloca i64
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca [64 x i8]
%16 = alloca [3 x i8*]
%17 = alloca [1 x i8*]
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%21 = load i32, i32* %4
%22 = icmp sgt i32 %21, 1
br i1 %22, label %23, label %60
23: ; preds = %2
%24 = load i8**, i8*** %5
%25 = getelementptr inbounds i8*, i8** %24, i64 1
%26 = load i8*, i8** %25
%27 = getelementptr inbounds %struct.timespec, %struct.timespec* %6, i32 0, i32 0
%28 = call i32 @sscanf(i8* %26, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64* %27)
%29 = icmp ne i32 %28, 1
br i1 %29, label %30, label %33
30: ; preds = %23
%31 = call i32 @ksft_test_result_error(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
store i32 -1, i32* %11
%32 = load i32, i32* %11
store i32 %32, i32* %3
br label %173
33: ; preds = %23
store i32 0, i32* %9
br label %34
34: ; preds = %56, %33
%35 = load i32, i32* %9
%36 = icmp slt i32 %35, 2
br i1 %36, label %37, label %59
37: ; preds = %34
%38 = load i32, i32* @CLOCK_MONOTONIC
%39 = load i32, i32* %9
%40 = call i32 @_gettime(i32 %38, %struct.timespec* %7, i32 %39)
%41 = getelementptr inbounds %struct.timespec, %struct.timespec* %7, i32 0, i32 0
%42 = load i64, i64* %41
%43 = getelementptr inbounds %struct.timespec, %struct.timespec* %6, i32 0, i32 0
%44 = load i64, i64* %43
%45 = sub nsw i64 %42, %44
%46 = call i32 @abs(i64 %45)
%47 = icmp sgt i32 %46, 5
br i1 %47, label %48, label %55
48: ; preds = %37
%49 = getelementptr inbounds %struct.timespec, %struct.timespec* %6, i32 0, i32 0
%50 = load i64, i64* %49
%51 = getelementptr inbounds %struct.timespec, %struct.timespec* %7, i32 0, i32 0
%52 = load i64, i64* %51
%53 = call i32 @ksft_test_result_fail(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i64 %50, i64 %52)
store i32 -1, i32* %12
%54 = load i32, i32* %12
store i32 %54, i32* %3
br label %173
55: ; preds = %37
br label %56
56: ; preds = %55
%57 = load i32, i32* %9
%58 = add nsw i32 %57, 1
store i32 %58, i32* %9
br label %34
59: ; preds = %34
store i32 0, i32* %3
br label %173
60: ; preds = %2
%61 = call i32 (...) @nscheck()
%62 = call i32 @ksft_set_plan(i32 1)
%63 = load i32, i32* @CLOCK_MONOTONIC
%64 = call i32 @clock_gettime(i32 %63, %struct.timespec* %6)
%65 = call i64 (...) @unshare_timens()
%66 = icmp ne i64 %65, 0
br i1 %66, label %67, label %68
67: ; preds = %60
store i32 1, i32* %3
br label %173
68: ; preds = %60
%69 = load i32, i32* @CLOCK_MONOTONIC
%70 = call i64 @_settime(i32 %69, i32 36000)
%71 = icmp ne i64 %70, 0
br i1 %71, label %72, label %73
72: ; preds = %68
store i32 1, i32* %3
br label %173
73: ; preds = %68
store i32 0, i32* %9
br label %74
74: ; preds = %96, %73
%75 = load i32, i32* %9
%76 = icmp slt i32 %75, 2
br i1 %76, label %77, label %99
77: ; preds = %74
%78 = load i32, i32* @CLOCK_MONOTONIC
%79 = load i32, i32* %9
%80 = call i32 @_gettime(i32 %78, %struct.timespec* %7, i32 %79)
%81 = getelementptr inbounds %struct.timespec, %struct.timespec* %7, i32 0, i32 0
%82 = load i64, i64* %81
%83 = getelementptr inbounds %struct.timespec, %struct.timespec* %6, i32 0, i32 0
%84 = load i64, i64* %83
%85 = sub nsw i64 %82, %84
%86 = call i32 @abs(i64 %85)
%87 = icmp sgt i32 %86, 5
br i1 %87, label %88, label %95
88: ; preds = %77
%89 = getelementptr inbounds %struct.timespec, %struct.timespec* %6, i32 0, i32 0
%90 = load i64, i64* %89
%91 = getelementptr inbounds %struct.timespec, %struct.timespec* %7, i32 0, i32 0
%92 = load i64, i64* %91
%93 = call i32 @ksft_test_result_fail(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i64 %90, i64 %92)
store i32 -1, i32* %13
%94 = load i32, i32* %13
store i32 %94, i32* %3
br label %173
95: ; preds = %77
br label %96
96: ; preds = %95
%97 = load i32, i32* %9
%98 = add nsw i32 %97, 1
store i32 %98, i32* %9
br label %74
99: ; preds = %74
%100 = load i32, i32* %4
%101 = icmp sgt i32 %100, 1
br i1 %101, label %102, label %103
102: ; preds = %99
store i32 0, i32* %3
br label %173
103: ; preds = %99
%104 = call i64 (...) @fork()
store i64 %104, i64* %10
%105 = load i64, i64* %10
%106 = icmp slt i64 %105, 0
br i1 %106, label %107, label %110
107: ; preds = %103
%108 = call i32 @ksft_test_result_error(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
store i32 -1, i32* %14
%109 = load i32, i32* %14
store i32 %109, i32* %3
br label %173
110: ; preds = %103
%111 = load i64, i64* %10
%112 = icmp eq i64 %111, 0
br i1 %112, label %113, label %157
113: ; preds = %110
%114 = getelementptr inbounds [3 x i8*], [3 x i8*]* %16, i64 0, i64 0
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8** %114
%115 = getelementptr inbounds i8*, i8** %114, i64 1
%116 = getelementptr inbounds [64 x i8], [64 x i8]* %15, i64 0, i64 0
store i8* %116, i8** %115
%117 = getelementptr inbounds i8*, i8** %115, i64 1
store i8* null, i8** %117
%118 = bitcast [1 x i8*]* %17 to i8*
store i32 0, i32* %9
br label %119
119: ; preds = %143, %113
%120 = load i32, i32* %9
%121 = icmp slt i32 %120, 2
br i1 %121, label %122, label %146
122: ; preds = %119
%123 = load i32, i32* @CLOCK_MONOTONIC
%124 = load i32, i32* %9
%125 = call i32 @_gettime(i32 %123, %struct.timespec* %7, i32 %124)
%126 = getelementptr inbounds %struct.timespec, %struct.timespec* %7, i32 0, i32 0
%127 = load i64, i64* %126
%128 = getelementptr inbounds %struct.timespec, %struct.timespec* %6, i32 0, i32 0
%129 = load i64, i64* %128
%130 = sub nsw i64 %127, %129
%131 = sub nsw i64 %130, 36000
%132 = call i32 @abs(i64 %131)
%133 = icmp sgt i32 %132, 5
br i1 %133, label %134, label %142
134: ; preds = %122
%135 = getelementptr inbounds %struct.timespec, %struct.timespec* %6, i32 0, i32 0
%136 = load i64, i64* %135
%137 = add nsw i64 %136, 36000
%138 = getelementptr inbounds %struct.timespec, %struct.timespec* %7, i32 0, i32 0
%139 = load i64, i64* %138
%140 = call i32 @ksft_test_result_fail(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i64 %137, i64 %139)
store i32 -1, i32* %18
%141 = load i32, i32* %18
store i32 %141, i32* %3
br label %173
142: ; preds = %122
br label %143
143: ; preds = %142
%144 = load i32, i32* %9
%145 = add nsw i32 %144, 1
store i32 %145, i32* %9
br label %119
146: ; preds = %119
%147 = getelementptr inbounds [64 x i8], [64 x i8]* %15, i64 0, i64 0
%148 = getelementptr inbounds %struct.timespec, %struct.timespec* %6, i32 0, i32 0
%149 = load i64, i64* %148
%150 = add nsw i64 %149, 36000
%151 = call i32 @snprintf(i8* %147, i32 64, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %150)
%152 = getelementptr inbounds [3 x i8*], [3 x i8*]* %16, i64 0, i64 0
%153 = getelementptr inbounds [1 x i8*], [1 x i8*]* %17, i64 0, i64 0
%154 = call i32 @execve(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), i8** %152, i8** %153)
%155 = call i32 @ksft_test_result_error(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0))
store i32 -1, i32* %19
%156 = load i32, i32* %19
store i32 %156, i32* %3
br label %173
157: ; preds = %110
%158 = load i64, i64* %10
%159 = call i64 @waitpid(i64 %158, i32* %8, i32 0)
%160 = load i64, i64* %10
%161 = icmp ne i64 %159, %160
br i1 %161, label %162, label %165
162: ; preds = %157
%163 = call i32 @ksft_test_result_error(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0))
store i32 -1, i32* %20
%164 = load i32, i32* %20
store i32 %164, i32* %3
br label %173
165: ; preds = %157
%166 = load i32, i32* %8
%167 = icmp ne i32 %166, 0
br i1 %167, label %168, label %170
168: ; preds = %165
%169 = call i32 (...) @ksft_exit_fail()
br label %170
170: ; preds = %168, %165
%171 = call i32 @ksft_test_result_pass(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0))
%172 = call i32 (...) @ksft_exit_pass()
store i32 0, i32* %3
br label %173
173: ; preds = %170, %162, %146, %134, %107, %102, %88, %72, %67, %59, %48, %30
%174 = load i32, i32* %3
ret i32 %174
}

LLVM IR (-O2):
%struct.timespec = type { i64 }
@.str = [4 x i8] c"%ld\00"
@.str.1 = [12 x i8] c"sscanf: %m\0A\00"
@CLOCK_MONOTONIC = global i32 0
@.str.2 = [9 x i8] c"%ld %ld\0A\00"
@.str.3 = [10 x i8] c"fork: %m\0A\00"
@.str.4 = [5 x i8] c"exec\00"
@.str.5 = [15 x i8] c"/proc/self/exe\00"
@.str.6 = [12 x i8] c"execve: %m\0A\00"
@.str.7 = [13 x i8] c"waitpid: %m\0A\00"
@.str.8 = [6 x i8] c"exec\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca %struct.timespec
%4 = alloca %struct.timespec
%5 = alloca i32
%6 = alloca [64 x i8]
%7 = alloca [3 x i8*]
%8 = alloca [1 x i8*]
%9 = bitcast %struct.timespec* %3 to i8*
%10 = bitcast %struct.timespec* %4 to i8*
%11 = bitcast i32* %5 to i8*
%12 = icmp sgt i32 %0, 1
br i1 %12, label %13, label %42
13: ; preds = %2
%14 = getelementptr inbounds i8*, i8** %1, i64 1
%15 = load i8*, i8** %14
%16 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i64 0, i32 0
%17 = call i32 @sscanf(i8* %15, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64* %16)
%18 = icmp eq i32 %17, 1
br i1 %18, label %19, label %28
19: ; preds = %13
%20 = getelementptr inbounds %struct.timespec, %struct.timespec* %4, i64 0, i32 0
%21 = load i32, i32* @CLOCK_MONOTONIC
%22 = call i32 @_gettime(i32 %21, %struct.timespec* %4, i32 0)
%23 = load i64, i64* %20
%24 = load i64, i64* %16
%25 = sub nsw i64 %23, %24
%26 = call i32 @abs(i64 %25)
%27 = icmp sgt i32 %26, 5
br i1 %27, label %38, label %30
28: ; preds = %13
%29 = call i32 @ksft_test_result_error(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
br label %133
30: ; preds = %19
%31 = load i32, i32* @CLOCK_MONOTONIC
%32 = call i32 @_gettime(i32 %31, %struct.timespec* %4, i32 1)
%33 = load i64, i64* %20
%34 = load i64, i64* %16
%35 = sub nsw i64 %33, %34
%36 = call i32 @abs(i64 %35)
%37 = icmp sgt i32 %36, 5
br i1 %37, label %38, label %133
38: ; preds = %30, %19
%39 = load i64, i64* %16
%40 = load i64, i64* %20
%41 = call i32 @ksft_test_result_fail(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i64 %39, i64 %40)
br label %133
42: ; preds = %2
%43 = tail call i32 (...) @nscheck()
%44 = tail call i32 @ksft_set_plan(i32 1)
%45 = load i32, i32* @CLOCK_MONOTONIC
%46 = call i32 @clock_gettime(i32 %45, %struct.timespec* %3)
%47 = call i64 (...) @unshare_timens()
%48 = icmp eq i64 %47, 0
br i1 %48, label %49, label %133
49: ; preds = %42
%50 = load i32, i32* @CLOCK_MONOTONIC
%51 = call i64 @_settime(i32 %50, i32 36000)
%52 = icmp eq i64 %51, 0
br i1 %52, label %53, label %133
53: ; preds = %49
%54 = getelementptr inbounds %struct.timespec, %struct.timespec* %4, i64 0, i32 0
%55 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i64 0, i32 0
%56 = load i32, i32* @CLOCK_MONOTONIC
%57 = call i32 @_gettime(i32 %56, %struct.timespec* %4, i32 0)
%58 = load i64, i64* %54
%59 = load i64, i64* %55
%60 = sub nsw i64 %58, %59
%61 = call i32 @abs(i64 %60)
%62 = icmp sgt i32 %61, 5
br i1 %62, label %74, label %63
63: ; preds = %53
%64 = load i32, i32* @CLOCK_MONOTONIC
%65 = call i32 @_gettime(i32 %64, %struct.timespec* %4, i32 1)
%66 = load i64, i64* %54
%67 = load i64, i64* %55
%68 = sub nsw i64 %66, %67
%69 = call i32 @abs(i64 %68)
%70 = icmp sgt i32 %69, 5
br i1 %70, label %74, label %71
71: ; preds = %63
%72 = call i64 (...) @fork()
%73 = icmp slt i64 %72, 0
br i1 %73, label %78, label %80
74: ; preds = %63, %53
%75 = load i64, i64* %55
%76 = load i64, i64* %54
%77 = call i32 @ksft_test_result_fail(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i64 %75, i64 %76)
br label %133
78: ; preds = %71
%79 = call i32 @ksft_test_result_error(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
br label %133
80: ; preds = %71
%81 = icmp eq i64 %72, 0
br i1 %81, label %82, label %120
82: ; preds = %80
%83 = getelementptr inbounds [64 x i8], [64 x i8]* %6, i64 0, i64 0
%84 = bitcast [3 x i8*]* %7 to i8*
%85 = getelementptr inbounds [3 x i8*], [3 x i8*]* %7, i64 0, i64 0
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8** %85
%86 = getelementptr inbounds [3 x i8*], [3 x i8*]* %7, i64 0, i64 1
store i8* %83, i8** %86
%87 = getelementptr inbounds [3 x i8*], [3 x i8*]* %7, i64 0, i64 2
store i8* null, i8** %87
%88 = bitcast [1 x i8*]* %8 to i8*
%89 = bitcast [1 x i8*]* %8 to i64*
store i64 0, i64* %89
%90 = load i32, i32* @CLOCK_MONOTONIC
%91 = call i32 @_gettime(i32 %90, %struct.timespec* %4, i32 0)
%92 = load i64, i64* %54
%93 = load i64, i64* %55
%94 = add i64 %92, -36000
%95 = sub i64 %94, %93
%96 = call i32 @abs(i64 %95)
%97 = icmp sgt i32 %96, 5
br i1 %97, label %114, label %98
98: ; preds = %82
%99 = load i32, i32* @CLOCK_MONOTONIC
%100 = call i32 @_gettime(i32 %99, %struct.timespec* %4, i32 1)
%101 = load i64, i64* %54
%102 = load i64, i64* %55
%103 = add i64 %101, -36000
%104 = sub i64 %103, %102
%105 = call i32 @abs(i64 %104)
%106 = icmp sgt i32 %105, 5
br i1 %106, label %114, label %107
107: ; preds = %98
%108 = load i64, i64* %55
%109 = add nsw i64 %108, 36000
%110 = call i32 @snprintf(i8* %83, i32 64, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %109)
%111 = getelementptr inbounds [1 x i8*], [1 x i8*]* %8, i64 0, i64 0
%112 = call i32 @execve(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), i8** %85, i8** %111)
%113 = call i32 @ksft_test_result_error(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0))
br label %119
114: ; preds = %98, %82
%115 = load i64, i64* %55
%116 = add nsw i64 %115, 36000
%117 = load i64, i64* %54
%118 = call i32 @ksft_test_result_fail(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i64 %116, i64 %117)
br label %119
119: ; preds = %107, %114
br label %133
120: ; preds = %80
%121 = call i64 @waitpid(i64 %72, i32* %5, i32 0)
%122 = icmp eq i64 %121, %72
br i1 %122, label %125, label %123
123: ; preds = %120
%124 = call i32 @ksft_test_result_error(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0))
br label %133
125: ; preds = %120
%126 = load i32, i32* %5
%127 = icmp eq i32 %126, 0
br i1 %127, label %130, label %128
128: ; preds = %125
%129 = call i32 (...) @ksft_exit_fail()
br label %130
130: ; preds = %128, %125
%131 = call i32 @ksft_test_result_pass(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0))
%132 = call i32 (...) @ksft_exit_pass()
br label %133
133: ; preds = %30, %49, %42, %130, %123, %119, %78, %74, %38, %28
%134 = phi i32 [ -1, %28 ], [ -1, %38 ], [ -1, %74 ], [ -1, %78 ], [ -1, %119 ], [ -1, %123 ], [ 0, %130 ], [ 1, %42 ], [ 1, %49 ], [ 0, %30 ]
ret i32 %134
}