#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*/ time_t;
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int /*<<< orphan*/ MS_SYNC;
int /*<<< orphan*/ SIG_SETMASK;
int /*<<< orphan*/ msync(int /*<<< orphan*/ *, int, int /*<<< orphan*/);
int /*<<< orphan*/ sigfillset(int /*<<< orphan*/ *);
int /*<<< orphan*/ sigprocmask(int /*<<< orphan*/, int /*<<< orphan*/ *,
                               int /*<<< orphan*/ *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void update_last_run(time_t *last_run) {
  sigset_t full_set;
  sigfillset(&full_set);
  sigset_t old;
  sigprocmask(SIG_SETMASK, &full_set, &old);
  time(last_run);
  msync(last_run, sizeof *last_run, MS_SYNC);
  sigprocmask(SIG_SETMASK, &old, NULL);
}


x86 assembly (clang, -O0):
<update_last_run>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0xc(%rbp),%rdi
call   1050 <sigfillset@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
lea    -0xc(%rbp),%rsi
lea    -0x10(%rbp),%rdx
call   1030 <sigprocmask@plt>
mov    -0x8(%rbp),%rdi
call   1060 <time@plt>
mov    -0x8(%rbp),%rdi
mov    0x2e59(%rip),%rax
mov    (%rax),%edx
mov    $0x4,%esi
call   1040 <msync@plt>
mov    0x2e56(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <sigprocmask@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<update_last_run>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0x4(%rsp),%r14
mov    %r14,%rdi
call   1050 <sigfillset@plt>
mov    0x2e89(%rip),%r12
mov    (%r12),%edi
mov    %rsp,%r15
mov    %r14,%rsi
mov    %r15,%rdx
call   1030 <sigprocmask@plt>
mov    %rbx,%rdi
call   1060 <time@plt>
mov    0x2e58(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
mov    $0x4,%esi
call   1040 <msync@plt>
mov    (%r12),%edi
mov    %r15,%rsi
xor    %edx,%edx
call   1030 <sigprocmask@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@SIG_SETMASK = global i32 0
@MS_SYNC = global i32 0
define void @update_last_run(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
%5 = call i32 @sigfillset(i32* %3)
%6 = load i32, i32* @SIG_SETMASK
%7 = call i32 @sigprocmask(i32 %6, i32* %3, i32* %4)
%8 = load i32*, i32** %2
%9 = call i32 @time(i32* %8)
%10 = load i32*, i32** %2
%11 = load i32, i32* @MS_SYNC
%12 = call i32 @msync(i32* %10, i32 4, i32 %11)
%13 = load i32, i32* @SIG_SETMASK
%14 = call i32 @sigprocmask(i32 %13, i32* %4, i32* null)
ret void
}

LLVM IR (-O2):
@SIG_SETMASK = global i32 0
@MS_SYNC = global i32 0
define void @update_last_run(i32* %0) {
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %2 to i8*
%5 = call i32 @sigfillset(i32* %2)
%6 = bitcast i32* %3 to i8*
%7 = load i32, i32* @SIG_SETMASK
%8 = call i32 @sigprocmask(i32 %7, i32* %2, i32* %3)
%9 = call i32 @time(i32* %0)
%10 = load i32, i32* @MS_SYNC
%11 = call i32 @msync(i32* %0, i32 4, i32 %10)
%12 = load i32, i32* @SIG_SETMASK
%13 = call i32 @sigprocmask(i32 %12, i32* %3, i32* null)
ret void
}