#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 pppTimer {
  int dummy;
};
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int /*<<< orphan*/ SIGALRM;
int /*<<< orphan*/ SIG_BLOCK;
int /*<<< orphan*/ SIG_SETMASK;
int /*<<< orphan*/ StopTimerNoBlock(struct pppTimer *);
int /*<<< orphan*/ sigaddset(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ sigemptyset(int /*<<< orphan*/ *);
int /*<<< orphan*/ sigprocmask(int /*<<< orphan*/, int /*<<< orphan*/ *,
                               int /*<<< orphan*/ *);
void timer_Stop(struct pppTimer *tp) {
  sigset_t mask, omask;
  sigemptyset(&mask);
  sigaddset(&mask, SIGALRM);
  sigprocmask(SIG_BLOCK, &mask, &omask);
  StopTimerNoBlock(tp);
  sigprocmask(SIG_SETMASK, &omask, NULL);
}


x86 assembly (clang, -O0):
<timer_Stop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0xc(%rbp),%rdi
call   1050 <sigemptyset@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%esi
lea    -0xc(%rbp),%rdi
call   1060 <sigaddset@plt>
mov    0x2e62(%rip),%rax
mov    (%rax),%edi
lea    -0xc(%rbp),%rsi
lea    -0x10(%rbp),%rdx
call   1030 <sigprocmask@plt>
mov    -0x8(%rbp),%rdi
call   1040 <StopTimerNoBlock@plt>
mov    0x2e53(%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):
<timer_Stop>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%r14
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <sigemptyset@plt>
mov    0x2e88(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1060 <sigaddset@plt>
mov    0x2e5f(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%r15
mov    %rbx,%rsi
mov    %r15,%rdx
call   1030 <sigprocmask@plt>
mov    %r14,%rdi
call   1040 <StopTimerNoBlock@plt>
mov    0x2e4e(%rip),%rax
mov    (%rax),%edi
mov    %r15,%rsi
xor    %edx,%edx
call   1030 <sigprocmask@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.pppTimer = type { i32 }
@SIGALRM = global i32 0
@SIG_BLOCK = global i32 0
@SIG_SETMASK = global i32 0
define void @timer_Stop(%struct.pppTimer* %0) {
%2 = alloca %struct.pppTimer*
%3 = alloca i32
%4 = alloca i32
store %struct.pppTimer* %0, %struct.pppTimer** %2
%5 = call i32 @sigemptyset(i32* %3)
%6 = load i32, i32* @SIGALRM
%7 = call i32 @sigaddset(i32* %3, i32 %6)
%8 = load i32, i32* @SIG_BLOCK
%9 = call i32 @sigprocmask(i32 %8, i32* %3, i32* %4)
%10 = load %struct.pppTimer*, %struct.pppTimer** %2
%11 = call i32 @StopTimerNoBlock(%struct.pppTimer* %10)
%12 = load i32, i32* @SIG_SETMASK
%13 = call i32 @sigprocmask(i32 %12, i32* %4, i32* null)
ret void
}

LLVM IR (-O2):
%struct.pppTimer = type { i32 }
@SIGALRM = global i32 0
@SIG_BLOCK = global i32 0
@SIG_SETMASK = global i32 0
define void @timer_Stop(%struct.pppTimer* %0) {
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %2 to i8*
%5 = bitcast i32* %3 to i8*
%6 = call i32 @sigemptyset(i32* %2)
%7 = load i32, i32* @SIGALRM
%8 = call i32 @sigaddset(i32* %2, i32 %7)
%9 = load i32, i32* @SIG_BLOCK
%10 = call i32 @sigprocmask(i32 %9, i32* %2, i32* %3)
%11 = call i32 @StopTimerNoBlock(%struct.pppTimer* %0)
%12 = load i32, i32* @SIG_SETMASK
%13 = call i32 @sigprocmask(i32 %12, i32* %3, i32* null)
ret void
}