#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__ {
  scalar_t__ si_code;
  TYPE_1__ si_value;
};
typedef TYPE_2__ siginfo_t;

/* Variables and functions */
scalar_t__ SI_QUEUE;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void handler(int numero, siginfo_t *info, void *unused) {
  fprintf(stderr, "(%d", numero);
  if ((info != NULL) && (info->si_code == SI_QUEUE)) {
    fprintf(stderr, " avec %d", info->si_value.sival_int);
  }
  fprintf(stderr, ")");
}


x86 assembly (clang, -O0):
<handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xeca(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
cmpq   $0x0,-0x10(%rbp)
je     117d <handler+0x6d>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    0x2e92(%rip),%rcx
cmp    (%rcx),%rax
jne    117d <handler+0x6d>
mov    0x2e72(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%edx
lea    0xe8e(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e54(%rip),%rax
mov    (%rax),%edi
lea    0xe80(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handler>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%edx
mov    0x2eb8(%rip),%r14
mov    (%r14),%edi
lea    0xed6(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
test   %rbx,%rbx
je     1159 <handler+0x49>
mov    (%rbx),%rax
mov    0x2ea8(%rip),%rcx
cmp    (%rcx),%rax
jne    1159 <handler+0x49>
mov    (%r14),%edi
mov    0x8(%rbx),%edx
lea    0xeb2(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0xeaa(%rip),%rsi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
%struct.TYPE_5__ = type { i64, %struct.TYPE_4__ }
%struct.TYPE_4__ = type { i32 }
@stderr = global i32 0
@.str = [4 x i8] c"(%d\00"
@SI_QUEUE = global i64 0
@.str.1 = [9 x i8] c" avec %d\00"
@.str.2 = [2 x i8] c")\00"
define void @handler(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* @stderr
%8 = load i32, i32* %4
%9 = call i32 (i32, i8*, ...) @fprintf(i32 %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = load %struct.TYPE_5__*, %struct.TYPE_5__** %5
%11 = icmp ne %struct.TYPE_5__* %10, null
br i1 %11, label %12, label %25
12: ; preds = %3
%13 = load %struct.TYPE_5__*, %struct.TYPE_5__** %5
%14 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %13, i32 0, i32 0
%15 = load i64, i64* %14
%16 = load i64, i64* @SI_QUEUE
%17 = icmp eq i64 %15, %16
br i1 %17, label %18, label %25
18: ; preds = %12
%19 = load i32, i32* @stderr
%20 = load %struct.TYPE_5__*, %struct.TYPE_5__** %5
%21 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %20, i32 0, i32 1
%22 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %21, i32 0, i32 0
%23 = load i32, i32* %22
%24 = call i32 (i32, i8*, ...) @fprintf(i32 %19, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %23)
br label %25
25: ; preds = %18, %12, %3
%26 = load i32, i32* @stderr
%27 = call i32 (i32, i8*, ...) @fprintf(i32 %26, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.TYPE_5__ = type { i64, %struct.TYPE_4__ }
%struct.TYPE_4__ = type { i32 }
@stderr = global i32 0
@.str = [4 x i8] c"(%d\00"
@SI_QUEUE = global i64 0
@.str.1 = [9 x i8] c" avec %d\00"
@.str.2 = [2 x i8] c")\00"
define void @handler(i32 %0, %struct.TYPE_5__* %1, i8* nocapture readnone %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
%6 = icmp eq %struct.TYPE_5__* %1, null
br i1 %6, label %17, label %7
7: ; preds = %3
%8 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %1, i64 0, i32 0
%9 = load i64, i64* %8
%10 = load i64, i64* @SI_QUEUE
%11 = icmp eq i64 %9, %10
br i1 %11, label %12, label %17
12: ; preds = %7
%13 = load i32, i32* @stderr
%14 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %1, i64 0, i32 1, i32 0
%15 = load i32, i32* %14
%16 = tail call i32 (i32, i8*, ...) @fprintf(i32 %13, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %12, %7, %3
%18 = load i32, i32* @stderr
%19 = tail call i32 (i32, i8*, ...) @fprintf(i32 %18, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret void
}