#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 socket_server {
  int dummy;
};
struct sigaction {
  int /*<<< orphan*/ sa_handler;
};

/* Variables and functions */
int /*<<< orphan*/ SIGPIPE;
int /*<<< orphan*/ SIG_IGN;
int /*<<< orphan*/ sigaction(int /*<<< orphan*/, struct sigaction *,
                             int /*<<< orphan*/);
struct socket_server *socket_server_create();
int /*<<< orphan*/ socket_server_release(struct socket_server *);
int /*<<< orphan*/ test(struct socket_server *);
int main() {
  struct sigaction sa;
  sa.sa_handler = SIG_IGN;
  sigaction(SIGPIPE, &sa, 0);
  struct socket_server *ss = socket_server_create();
  test(ss);
  socket_server_release(ss);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e92(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    0x2e76(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
xor    %edx,%edx
call   1030 <sigaction@plt>
mov    $0x0,%al
call   1050 <socket_server_create@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1060 <test@plt>
mov    -0x10(%rbp),%rdi
call   1040 <socket_server_release@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
mov    0x2e9c(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x8(%rsp)
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rsi
xor    %edx,%edx
call   1030 <sigaction@plt>
xor    %eax,%eax
call   1050 <socket_server_create@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1060 <test@plt>
mov    %rbx,%rdi
call   1040 <socket_server_release@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.sigaction = type { i32 }
%struct.socket_server = type { i32 }
@SIG_IGN = global i32 0
@SIGPIPE = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.sigaction
%3 = alloca %struct.socket_server*
store i32 0, i32* %1
%4 = load i32, i32* @SIG_IGN
%5 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %2, i32 0, i32 0
store i32 %4, i32* %5
%6 = load i32, i32* @SIGPIPE
%7 = call i32 @sigaction(i32 %6, %struct.sigaction* %2, i32 0)
%8 = call %struct.socket_server* (...) @socket_server_create()
store %struct.socket_server* %8, %struct.socket_server** %3
%9 = load %struct.socket_server*, %struct.socket_server** %3
%10 = call i32 @test(%struct.socket_server* %9)
%11 = load %struct.socket_server*, %struct.socket_server** %3
%12 = call i32 @socket_server_release(%struct.socket_server* %11)
ret i32 0
}

LLVM IR (-O2):
%struct.sigaction = type { i32 }
%struct.socket_server = type { i32 }
@SIG_IGN = global i32 0
@SIGPIPE = global i32 0
define i32 @main() {
%1 = alloca %struct.sigaction
%2 = bitcast %struct.sigaction* %1 to i8*
%3 = load i32, i32* @SIG_IGN
%4 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %1, i64 0, i32 0
store i32 %3, i32* %4
%5 = load i32, i32* @SIGPIPE
%6 = call i32 @sigaction(i32 %5, %struct.sigaction* %1, i32 0)
%7 = call %struct.socket_server* (...) @socket_server_create()
%8 = call i32 @test(%struct.socket_server* %7)
%9 = call i32 @socket_server_release(%struct.socket_server* %7)
ret i32 0
}