#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 si_signo;
  int *si_addr;
};
typedef TYPE_1__ siginfo_t;

/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int, int *, void *);
void saction(int n, siginfo_t *info, void *arg) {
  printf("signo %d\nsi_addr %p\nsi_addr+4 %p\n", info->si_signo, info->si_addr,
         ((void **)&info->si_addr)[1]);
  if (info->si_addr == (int *)0x12345678)
    exit(0);
  abort();
}


x86 assembly (clang, -O0):
<saction>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rcx
lea    0xea0(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
mov    $0x12345678,%ecx
cmp    %rcx,0x8(%rax)
jne    117f <saction+0x4f>
xor    %edi,%edi
call   1050 <exit@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<saction>:
push   %rbx
mov    %rsi,%rbx
mov    (%rsi),%esi
mov    0x8(%rbx),%rdx
mov    0x10(%rbx),%rcx
lea    0xebb(%rip),%rdi
call   1040 <printf@plt>
cmpq   $0x12345678,0x8(%rbx)
12
jne    115b <saction+0x2b>
xor    %edi,%edi
call   1050 <exit@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32, i32* }
@.str = [34 x i8] c"signo %d\0Asi_addr %p\0Asi_addr+4 %p\0A\00"
define void @saction(i32 %0, %struct.TYPE_3__* %1, i8* %2) {
%4 = alloca i32
%5 = alloca %struct.TYPE_3__*
%6 = alloca i8*
store i32 %0, i32* %4
store %struct.TYPE_3__* %1, %struct.TYPE_3__** %5
store i8* %2, i8** %6
%7 = load %struct.TYPE_3__*, %struct.TYPE_3__** %5
%8 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %7, i32 0, i32 0
%9 = load i32, i32* %8
%10 = load %struct.TYPE_3__*, %struct.TYPE_3__** %5
%11 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %10, i32 0, i32 1
%12 = load i32*, i32** %11
%13 = load %struct.TYPE_3__*, %struct.TYPE_3__** %5
%14 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %13, i32 0, i32 1
%15 = bitcast i32** %14 to i8**
%16 = getelementptr inbounds i8*, i8** %15, i64 1
%17 = load i8*, i8** %16
%18 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %9, i32* %12, i8* %17)
%19 = load %struct.TYPE_3__*, %struct.TYPE_3__** %5
%20 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %19, i32 0, i32 1
%21 = load i32*, i32** %20
%22 = icmp eq i32* %21, inttoptr (i64 305419896 to i32*)
br i1 %22, label %23, label %25
23: ; preds = %3
%24 = call i32 @exit(i32 0)
unreachable
25: ; preds = %3
%26 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32, i32* }
@.str = [34 x i8] c"signo %d\0Asi_addr %p\0Asi_addr+4 %p\0A\00"
define void @saction(i32 %0, %struct.TYPE_3__* nocapture %1, i8* nocapture readnone %2) {
%4 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %1, i64 0, i32 1
%7 = load i32*, i32** %6
%8 = getelementptr inbounds i32*, i32** %6, i64 1
%9 = bitcast i32** %8 to i8**
%10 = load i8*, i8** %9
%11 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %5, i32* %7, i8* %10)
%12 = load i32*, i32** %6
%13 = icmp eq i32* %12, inttoptr (i64 305419896 to i32*)
br i1 %13, label %14, label %16
14: ; preds = %3
%15 = tail call i32 @exit(i32 0)
unreachable
16: ; preds = %3
%17 = tail call i32 (...) @abort()
unreachable
}