#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_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int /*<<< orphan*/ sival_int;
};
typedef TYPE_1__ sigval_t;

/* Variables and functions */
int /*<<< orphan*/ SIGINT;
int /*<<< orphan*/ atoi(char *);
int getpid();
int getuid();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ sigqueue(int /*<<< orphan*/, int /*<<< orphan*/, TYPE_1__);
int main(int argc, char *argv[]) {
  if (argc != 3) {
    printf("%s pid intvl\n", argv[0]);
    return 0;
  }
  sigval_t s;
  s.sival_int = atoi(argv[2]);
  sigqueue(atoi(argv[1]), SIGINT, s);
  printf("mypid=%d, myuid=%d\n", getpid(), getuid());
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
je     1191 <main+0x41>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xe82(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    11e5 <main+0x95>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1070 <atoi@plt>
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1070 <atoi@plt>
mov    %eax,%edi
mov    0x2e31(%rip),%rax
mov    (%rax),%esi
mov    -0x18(%rbp),%edx
call   1060 <sigqueue@plt>
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,-0x1c(%rbp)
mov    $0x0,%al
call   1040 <getuid@plt>
mov    -0x1c(%rbp),%esi
mov    %eax,%edx
lea    0xe30(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
cmp    $0x3,%edi
jne    11a5 <main+0x55>
mov    0x10(%rbx),%rdi
call   1070 <atoi@plt>
mov    %eax,%ebp
mov    0x8(%rbx),%rdi
call   1070 <atoi@plt>
mov    0x2e72(%rip),%rcx
mov    (%rcx),%esi
mov    %eax,%edi
mov    %ebp,%edx
call   1060 <sigqueue@plt>
xor    %eax,%eax
call   1030 <getpid@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <getuid@plt>
lea    0xe76(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1050 <printf@plt>
jmp    11b6 <main+0x66>
mov    (%rbx),%rsi
lea    0xe51(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32 }
@.str = [14 x i8] c"%s pid intvl\0A\00"
@SIGINT = global i32 0
@.str.1 = [20 x i8] c"mypid=%d, myuid=%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.TYPE_3__
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 3
br i1 %8, label %9, label %14
9: ; preds = %2
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 0
%12 = load i8*, i8** %11
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %12)
store i32 0, i32* %3
br label %31
14: ; preds = %2
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 2
%17 = load i8*, i8** %16
%18 = call i32 @atoi(i8* %17)
%19 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %6, i32 0, i32 0
store i32 %18, i32* %19
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds i8*, i8** %20, i64 1
%22 = load i8*, i8** %21
%23 = call i32 @atoi(i8* %22)
%24 = load i32, i32* @SIGINT
%25 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %6, i32 0, i32 0
%26 = load i32, i32* %25
%27 = call i32 @sigqueue(i32 %23, i32 %24, i32 %26)
%28 = call i32 (...) @getpid()
%29 = call i32 (...) @getuid()
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %28, i32 %29)
br label %31
31: ; preds = %14, %9
%32 = load i32, i32* %3
ret i32 %32
}

LLVM IR (-O2):
@.str = [14 x i8] c"%s pid intvl\0A\00"
@SIGINT = global i32 0
@.str.1 = [20 x i8] c"mypid=%d, myuid=%d\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 3
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %5)
br label %19
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 2
%9 = load i8*, i8** %8
%10 = tail call i32 @atoi(i8* %9)
%11 = getelementptr inbounds i8*, i8** %1, i64 1
%12 = load i8*, i8** %11
%13 = tail call i32 @atoi(i8* %12)
%14 = load i32, i32* @SIGINT
%15 = tail call i32 @sigqueue(i32 %13, i32 %14, i32 %10)
%16 = tail call i32 (...) @getpid()
%17 = tail call i32 (...) @getuid()
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %16, i32 %17)
br label %19
19: ; preds = %7, %4
ret i32 0
}