#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_5__ TYPE_2__;
typedef struct TYPE_4__ TYPE_1__;

/* Type definitions */
struct TYPE_4__ {
  int sival_int;
};
struct TYPE_5__ {
  TYPE_1__ si_value;
};
typedef TYPE_2__ siginfo_t;

/* Variables and functions */
int SIGRTMIN;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void myhandler(int signo, siginfo_t *info,
               void *context __attribute__((unused))) {
  if (signo == SIGRTMIN && info->si_value.sival_int == 100) {
    printf("sigqueue()'s signo and value parameters were passed to the child "
           "process.\n");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<myhandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2ea3(%rip),%rcx
cmp    (%rcx),%eax
jne    1168 <myhandler+0x48>
mov    -0x10(%rbp),%rax
cmpl   $0x64,(%rax)
jne    1168 <myhandler+0x48>
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myhandler>:
push   %rax
mov    0x2eb8(%rip),%rax
cmp    %edi,(%rax)
jne    1131 <myhandler+0x11>
cmpl   $0x64,(%rsi)
je     1133 <myhandler+0x13>
pop    %rax
ret
lea    0xec6(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
%struct.TYPE_5__ = type { %struct.TYPE_4__ }
%struct.TYPE_4__ = type { i32 }
@SIGRTMIN = global i32 0
@.str = [75 x i8] c"sigqueue()'s signo and value parameters were passed to the child process.\0A\00"
define void @myhandler(i32 %0, %struct.TYPE_5__* %1, i8* %2) {
%4 = alloca i32
%5 = alloca %struct.TYPE_5__*
%6 = alloca i8*
store i32 %0, i32* %4
store %struct.TYPE_5__* %1, %struct.TYPE_5__** %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = load i32, i32* @SIGRTMIN
%9 = icmp eq i32 %7, %8
br i1 %9, label %10, label %19
10: ; preds = %3
%11 = load %struct.TYPE_5__*, %struct.TYPE_5__** %5
%12 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %11, i32 0, i32 0
%13 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %12, i32 0, i32 0
%14 = load i32, i32* %13
%15 = icmp eq i32 %14, 100
br i1 %15, label %16, label %19
16: ; preds = %10
%17 = call i32 @printf(i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str, i64 0, i64 0))
%18 = call i32 @exit(i32 1)
unreachable
19: ; preds = %10, %3
ret void
}

LLVM IR (-O2):
%struct.TYPE_5__ = type { %struct.TYPE_4__ }
%struct.TYPE_4__ = type { i32 }
@SIGRTMIN = global i32 0
@str = [74 x i8] c"sigqueue()'s signo and value parameters were passed to the child process.\00"
define void @myhandler(i32 %0, %struct.TYPE_5__* nocapture %1, i8* nocapture readnone %2) {
%4 = load i32, i32* @SIGRTMIN
%5 = icmp eq i32 %4, %0
br i1 %5, label %6, label %13
6: ; preds = %3
%7 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %1, i64 0, i32 0, i32 0
%8 = load i32, i32* %7
%9 = icmp eq i32 %8, 100
br i1 %9, label %10, label %13
10: ; preds = %6
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([74 x i8], [74 x i8]* @str, i64 0, i64 0))
%12 = tail call i32 @exit(i32 1)
unreachable
13: ; preds = %6, %3
ret void
}