#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 */
typedef int socklen_t;
typedef int /*<<< orphan*/ so_type;
typedef int /*<<< orphan*/ sndbuf_size;
typedef int /*<<< orphan*/ rcvbuf_size;

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ SOCK_STREAM;
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ SO_RCVBUF;
int /*<<< orphan*/ SO_SNDBUF;
int /*<<< orphan*/ SO_TYPE;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int getsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/, int *, int *);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, ...);
int setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/, int *, int);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int main() {
  int sockfd, return_val;
  int sndbuf_size = 0;
  int rcvbuf_size = 0;
  int so_type = 0;
  socklen_t optlen;
  if ((sockfd = socket(AF_INET, SOCK_STREAM, 0)) < 0) {
    perror("socket() error");
    exit(EXIT_FAILURE);
  }
  printf("socket fd: %d\n", sockfd);
  optlen = sizeof(sndbuf_size);
  if ((return_val = getsockopt(sockfd, SOL_SOCKET, SO_SNDBUF, &sndbuf_size,
                               &optlen)) < 0) {
    perror("getsockopt() error");
    exit(EXIT_FAILURE);
  }
  printf("SO_SNDBUF: %d\n", sndbuf_size);
  optlen = sizeof(rcvbuf_size);
  if ((return_val = getsockopt(sockfd, SOL_SOCKET, SO_RCVBUF, &rcvbuf_size,
                               &optlen)) < 0) {
    perror("getsockopt() error");
    exit(EXIT_FAILURE);
  }
  printf("SO_RCVBUF: %d\n", rcvbuf_size);
  printf("call setsockopt() to set SO_SNDBUF option.\n");
  sndbuf_size = 5000;
  optlen = sizeof(sndbuf_size);
  if ((return_val = setsockopt(sockfd, SOL_SOCKET, SO_SNDBUF, &sndbuf_size,
                               optlen)) < 0) {
    perror("setsockopt() error");
    exit(EXIT_FAILURE);
  }
  printf("set SO_SNDBUF: %d\n", sndbuf_size);
  optlen = sizeof(sndbuf_size);
  if ((return_val = getsockopt(sockfd, SOL_SOCKET, SO_SNDBUF, &sndbuf_size,
                               &optlen)) < 0) {
    perror("getsockopt() error");
    exit(EXIT_FAILURE);
  }
  printf("get SO_SNDBUF: %d\n", sndbuf_size);
  optlen = sizeof(rcvbuf_size);
  if ((return_val = getsockopt(sockfd, SOL_SOCKET, SO_RCVBUF, &rcvbuf_size,
                               &optlen)) < 0) {
    perror("getsockopt() error");
    exit(EXIT_FAILURE);
  }
  printf("get SO_RCVBUF: %d\n", rcvbuf_size);
  optlen = sizeof(so_type);
  if ((return_val =
           getsockopt(sockfd, SOL_SOCKET, SO_TYPE, &so_type, &optlen)) < 0) {
    perror("getsockopt() error");
    exit(EXIT_FAILURE);
  }
  printf("get SO_TYPE: %d\n", so_type);
  close(sockfd);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    0x2e45(%rip),%rax
mov    (%rax),%edi
mov    0x2e14(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1090 <socket@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jge    11d3 <main+0x63>
lea    0xe40(%rip),%rdi
call   1070 <perror@plt>
mov    0x2de4(%rip),%rax
mov    (%rax),%edi
call   1080 <exit@plt>
mov    -0x8(%rbp),%esi
lea    0xe32(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x4,-0x1c(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2df3(%rip),%rax
mov    (%rax),%esi
mov    0x2dda(%rip),%rax
mov    (%rax),%edx
lea    -0x10(%rbp),%rcx
lea    -0x1c(%rbp),%r8
call   1060 <getsockopt@plt>
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
jge    1233 <main+0xc3>
lea    0xdfe(%rip),%rdi
call   1070 <perror@plt>
mov    0x2d84(%rip),%rax
mov    (%rax),%edi
call   1080 <exit@plt>
mov    -0x10(%rbp),%esi
lea    0xe4a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x4,-0x1c(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2d93(%rip),%rax
mov    (%rax),%esi
mov    0x2d62(%rip),%rax
mov    (%rax),%edx
lea    -0x14(%rbp),%rcx
lea    -0x1c(%rbp),%r8
call   1060 <getsockopt@plt>
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
jge    1293 <main+0x123>
lea    0xd9e(%rip),%rdi
call   1070 <perror@plt>
mov    0x2d24(%rip),%rax
mov    (%rax),%edi
call   1080 <exit@plt>
mov    -0x14(%rbp),%esi
lea    0xdfd(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xd86(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x1388,-0x10(%rbp)
movl   $0x4,-0x1c(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2d1e(%rip),%rax
mov    (%rax),%esi
mov    0x2d05(%rip),%rax
mov    (%rax),%edx
mov    -0x1c(%rbp),%r8d
lea    -0x10(%rbp),%rcx
call   1030 <setsockopt@plt>
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
jge    1308 <main+0x198>
lea    0xd68(%rip),%rdi
call   1070 <perror@plt>
mov    0x2caf(%rip),%rax
mov    (%rax),%edi
call   1080 <exit@plt>
mov    -0x10(%rbp),%esi
lea    0xd5e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x4,-0x1c(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2cbe(%rip),%rax
mov    (%rax),%esi
mov    0x2ca5(%rip),%rax
mov    (%rax),%edx
lea    -0x10(%rbp),%rcx
lea    -0x1c(%rbp),%r8
call   1060 <getsockopt@plt>
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
jge    1368 <main+0x1f8>
lea    0xcc9(%rip),%rdi
call   1070 <perror@plt>
mov    0x2c4f(%rip),%rax
mov    (%rax),%edi
call   1080 <exit@plt>
mov    -0x10(%rbp),%esi
lea    0xd11(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x4,-0x1c(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2c5e(%rip),%rax
mov    (%rax),%esi
mov    0x2c2d(%rip),%rax
mov    (%rax),%edx
lea    -0x14(%rbp),%rcx
lea    -0x1c(%rbp),%r8
call   1060 <getsockopt@plt>
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
jge    13c8 <main+0x258>
lea    0xc69(%rip),%rdi
call   1070 <perror@plt>
mov    0x2bef(%rip),%rax
mov    (%rax),%edi
call   1080 <exit@plt>
mov    -0x14(%rbp),%esi
lea    0xcc4(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x4,-0x1c(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2bfe(%rip),%rax
mov    (%rax),%esi
mov    0x2bdd(%rip),%rax
mov    (%rax),%edx
lea    -0x18(%rbp),%rcx
lea    -0x1c(%rbp),%r8
call   1060 <getsockopt@plt>
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
jge    1428 <main+0x2b8>
lea    0xc09(%rip),%rdi
call   1070 <perror@plt>
mov    0x2b8f(%rip),%rax
mov    (%rax),%edi
call   1080 <exit@plt>
mov    -0x18(%rbp),%esi
lea    0xc77(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%edi
call   1050 <close@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x18,%rsp
movl   $0x0,0xc(%rsp)
movl   $0x0,0x10(%rsp)
movl   $0x0,0x14(%rsp)
mov    0x2e36(%rip),%rax
mov    (%rax),%edi
mov    0x2e05(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   10a0 <socket@plt>
test   %eax,%eax
js     1385 <main+0x205>
mov    %eax,%ebx
lea    0xe42(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
movl   $0x4,0x8(%rsp)
mov    0x2e03(%rip),%r14
mov    (%r14),%esi
mov    0x2de9(%rip),%r15
mov    (%r15),%edx
lea    0xc(%rsp),%rcx
lea    0x8(%rsp),%r8
mov    %ebx,%edi
call   1070 <getsockopt@plt>
test   %eax,%eax
js     136b <main+0x1eb>
mov    0xc(%rsp),%esi
lea    0xe45(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movl   $0x4,0x8(%rsp)
mov    (%r14),%esi
mov    0x2d91(%rip),%r12
mov    (%r12),%edx
lea    0x10(%rsp),%rcx
lea    0x8(%rsp),%r8
mov    %ebx,%edi
call   1070 <getsockopt@plt>
test   %eax,%eax
js     136b <main+0x1eb>
mov    0x10(%rsp),%esi
lea    0xe17(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe29(%rip),%rdi
call   1030 <puts@plt>
movl   $0x1388,0xc(%rsp)
movl   $0x4,0x8(%rsp)
mov    (%r14),%esi
mov    (%r15),%edx
lea    0xc(%rsp),%rcx
mov    %ebx,%edi
mov    $0x4,%r8d
call   1040 <setsockopt@plt>
test   %eax,%eax
js     138e <main+0x20e>
mov    0xc(%rsp),%esi
lea    0xd9f(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movl   $0x4,0x8(%rsp)
mov    (%r14),%esi
mov    (%r15),%edx
lea    0xc(%rsp),%rcx
lea    0x8(%rsp),%r8
mov    %ebx,%edi
call   1070 <getsockopt@plt>
test   %eax,%eax
js     136b <main+0x1eb>
mov    0xc(%rsp),%esi
lea    0xd79(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movl   $0x4,0x8(%rsp)
mov    (%r14),%esi
mov    (%r12),%edx
lea    0x10(%rsp),%rcx
lea    0x8(%rsp),%r8
mov    %ebx,%edi
call   1070 <getsockopt@plt>
test   %eax,%eax
js     136b <main+0x1eb>
mov    0x10(%rsp),%esi
lea    0xd56(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movl   $0x4,0x8(%rsp)
mov    (%r14),%esi
mov    0x2ca3(%rip),%rax
mov    (%rax),%edx
lea    0x14(%rsp),%rcx
lea    0x8(%rsp),%r8
mov    %ebx,%edi
call   1070 <getsockopt@plt>
test   %eax,%eax
js     136b <main+0x1eb>
mov    0x14(%rsp),%esi
lea    0xd2e(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %ebx,%edi
call   1060 <close@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret
lea    0xcac(%rip),%rdi
call   1080 <perror@plt>
mov    0x2c32(%rip),%rax
mov    (%rax),%edi
call   1090 <exit@plt>
lea    0xc74(%rip),%rdi
jmp    1372 <main+0x1f2>
lea    0xc9c(%rip),%rdi
jmp    1372 <main+0x1f2>

LLVM IR (-O0):
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str = [15 x i8] c"socket() error\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [15 x i8] c"socket fd: %d\0A\00"
@SOL_SOCKET = global i32 0
@SO_SNDBUF = global i32 0
@.str.2 = [19 x i8] c"getsockopt() error\00"
@.str.3 = [15 x i8] c"SO_SNDBUF: %d\0A\00"
@SO_RCVBUF = global i32 0
@.str.4 = [15 x i8] c"SO_RCVBUF: %d\0A\00"
@.str.5 = [44 x i8] c"call setsockopt() to set SO_SNDBUF option.\0A\00"
@.str.6 = [19 x i8] c"setsockopt() error\00"
@.str.7 = [19 x i8] c"set SO_SNDBUF: %d\0A\00"
@.str.8 = [19 x i8] c"get SO_SNDBUF: %d\0A\00"
@.str.9 = [19 x i8] c"get SO_RCVBUF: %d\0A\00"
@SO_TYPE = global i32 0
@.str.10 = [17 x i8] c"get SO_TYPE: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %4
store i32 0, i32* %5
store i32 0, i32* %6
%8 = load i32, i32* @AF_INET
%9 = load i32, i32* @SOCK_STREAM
%10 = call i32 @socket(i32 %8, i32 %9, i32 0)
store i32 %10, i32* %2
%11 = icmp slt i32 %10, 0
br i1 %11, label %12, label %16
12: ; preds = %0
%13 = call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%14 = load i32, i32* @EXIT_FAILURE
%15 = call i32 @exit(i32 %14)
unreachable
16: ; preds = %0
%17 = load i32, i32* %2
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %17)
store i32 4, i32* %7
%19 = load i32, i32* %2
%20 = load i32, i32* @SOL_SOCKET
%21 = load i32, i32* @SO_SNDBUF
%22 = call i32 @getsockopt(i32 %19, i32 %20, i32 %21, i32* %4, i32* %7)
store i32 %22, i32* %3
%23 = icmp slt i32 %22, 0
br i1 %23, label %24, label %28
24: ; preds = %16
%25 = call i32 @perror(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
%26 = load i32, i32* @EXIT_FAILURE
%27 = call i32 @exit(i32 %26)
unreachable
28: ; preds = %16
%29 = load i32, i32* %4
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i32 %29)
store i32 4, i32* %7
%31 = load i32, i32* %2
%32 = load i32, i32* @SOL_SOCKET
%33 = load i32, i32* @SO_RCVBUF
%34 = call i32 @getsockopt(i32 %31, i32 %32, i32 %33, i32* %5, i32* %7)
store i32 %34, i32* %3
%35 = icmp slt i32 %34, 0
br i1 %35, label %36, label %40
36: ; preds = %28
%37 = call i32 @perror(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
%38 = load i32, i32* @EXIT_FAILURE
%39 = call i32 @exit(i32 %38)
unreachable
40: ; preds = %28
%41 = load i32, i32* %5
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i32 %41)
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.5, i64 0, i64 0))
store i32 5000, i32* %4
store i32 4, i32* %7
%44 = load i32, i32* %2
%45 = load i32, i32* @SOL_SOCKET
%46 = load i32, i32* @SO_SNDBUF
%47 = load i32, i32* %7
%48 = call i32 @setsockopt(i32 %44, i32 %45, i32 %46, i32* %4, i32 %47)
store i32 %48, i32* %3
%49 = icmp slt i32 %48, 0
br i1 %49, label %50, label %54
50: ; preds = %40
%51 = call i32 @perror(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0))
%52 = load i32, i32* @EXIT_FAILURE
%53 = call i32 @exit(i32 %52)
unreachable
54: ; preds = %40
%55 = load i32, i32* %4
%56 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.7, i64 0, i64 0), i32 %55)
store i32 4, i32* %7
%57 = load i32, i32* %2
%58 = load i32, i32* @SOL_SOCKET
%59 = load i32, i32* @SO_SNDBUF
%60 = call i32 @getsockopt(i32 %57, i32 %58, i32 %59, i32* %4, i32* %7)
store i32 %60, i32* %3
%61 = icmp slt i32 %60, 0
br i1 %61, label %62, label %66
62: ; preds = %54
%63 = call i32 @perror(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
%64 = load i32, i32* @EXIT_FAILURE
%65 = call i32 @exit(i32 %64)
unreachable
66: ; preds = %54
%67 = load i32, i32* %4
%68 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.8, i64 0, i64 0), i32 %67)
store i32 4, i32* %7
%69 = load i32, i32* %2
%70 = load i32, i32* @SOL_SOCKET
%71 = load i32, i32* @SO_RCVBUF
%72 = call i32 @getsockopt(i32 %69, i32 %70, i32 %71, i32* %5, i32* %7)
store i32 %72, i32* %3
%73 = icmp slt i32 %72, 0
br i1 %73, label %74, label %78
74: ; preds = %66
%75 = call i32 @perror(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
%76 = load i32, i32* @EXIT_FAILURE
%77 = call i32 @exit(i32 %76)
unreachable
78: ; preds = %66
%79 = load i32, i32* %5
%80 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.9, i64 0, i64 0), i32 %79)
store i32 4, i32* %7
%81 = load i32, i32* %2
%82 = load i32, i32* @SOL_SOCKET
%83 = load i32, i32* @SO_TYPE
%84 = call i32 @getsockopt(i32 %81, i32 %82, i32 %83, i32* %6, i32* %7)
store i32 %84, i32* %3
%85 = icmp slt i32 %84, 0
br i1 %85, label %86, label %90
86: ; preds = %78
%87 = call i32 @perror(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
%88 = load i32, i32* @EXIT_FAILURE
%89 = call i32 @exit(i32 %88)
unreachable
90: ; preds = %78
%91 = load i32, i32* %6
%92 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.10, i64 0, i64 0), i32 %91)
%93 = load i32, i32* %2
%94 = call i32 @close(i32 %93)
ret i32 0
}

LLVM IR (-O2):
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str = [15 x i8] c"socket() error\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [15 x i8] c"socket fd: %d\0A\00"
@SOL_SOCKET = global i32 0
@SO_SNDBUF = global i32 0
@.str.2 = [19 x i8] c"getsockopt() error\00"
@.str.3 = [15 x i8] c"SO_SNDBUF: %d\0A\00"
@SO_RCVBUF = global i32 0
@.str.4 = [15 x i8] c"SO_RCVBUF: %d\0A\00"
@.str.6 = [19 x i8] c"setsockopt() error\00"
@.str.7 = [19 x i8] c"set SO_SNDBUF: %d\0A\00"
@.str.8 = [19 x i8] c"get SO_SNDBUF: %d\0A\00"
@.str.9 = [19 x i8] c"get SO_RCVBUF: %d\0A\00"
@SO_TYPE = global i32 0
@.str.10 = [17 x i8] c"get SO_TYPE: %d\0A\00"
@str = [43 x i8] c"call setsockopt() to set SO_SNDBUF option.\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%6 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%7 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%8 = bitcast i32* %4 to i8*
%9 = load i32, i32* @AF_INET
%10 = load i32, i32* @SOCK_STREAM
%11 = tail call i32 @socket(i32 %9, i32 %10, i32 0)
%12 = icmp slt i32 %11, 0
br i1 %12, label %13, label %17
13: ; preds = %0
%14 = tail call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%15 = load i32, i32* @EXIT_FAILURE
%16 = tail call i32 @exit(i32 %15)
unreachable
17: ; preds = %0
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %11)
store i32 4, i32* %4
%19 = load i32, i32* @SOL_SOCKET
%20 = load i32, i32* @SO_SNDBUF
%21 = call i32 @getsockopt(i32 %11, i32 %19, i32 %20, i32* %1, i32* %4)
%22 = icmp slt i32 %21, 0
br i1 %22, label %23, label %27
23: ; preds = %17
%24 = call i32 @perror(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
%25 = load i32, i32* @EXIT_FAILURE
%26 = call i32 @exit(i32 %25)
unreachable
27: ; preds = %17
%28 = load i32, i32* %1
%29 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i32 %28)
store i32 4, i32* %4
%30 = load i32, i32* @SOL_SOCKET
%31 = load i32, i32* @SO_RCVBUF
%32 = call i32 @getsockopt(i32 %11, i32 %30, i32 %31, i32* %2, i32* %4)
%33 = icmp slt i32 %32, 0
br i1 %33, label %34, label %38
34: ; preds = %27
%35 = call i32 @perror(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
%36 = load i32, i32* @EXIT_FAILURE
%37 = call i32 @exit(i32 %36)
unreachable
38: ; preds = %27
%39 = load i32, i32* %2
%40 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i32 %39)
%41 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str, i64 0, i64 0))
store i32 5000, i32* %1
store i32 4, i32* %4
%42 = load i32, i32* @SOL_SOCKET
%43 = load i32, i32* @SO_SNDBUF
%44 = call i32 @setsockopt(i32 %11, i32 %42, i32 %43, i32* %1, i32 4)
%45 = icmp slt i32 %44, 0
br i1 %45, label %46, label %50
46: ; preds = %38
%47 = call i32 @perror(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0))
%48 = load i32, i32* @EXIT_FAILURE
%49 = call i32 @exit(i32 %48)
unreachable
50: ; preds = %38
%51 = load i32, i32* %1
%52 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.7, i64 0, i64 0), i32 %51)
store i32 4, i32* %4
%53 = load i32, i32* @SOL_SOCKET
%54 = load i32, i32* @SO_SNDBUF
%55 = call i32 @getsockopt(i32 %11, i32 %53, i32 %54, i32* %1, i32* %4)
%56 = icmp slt i32 %55, 0
br i1 %56, label %57, label %61
57: ; preds = %50
%58 = call i32 @perror(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
%59 = load i32, i32* @EXIT_FAILURE
%60 = call i32 @exit(i32 %59)
unreachable
61: ; preds = %50
%62 = load i32, i32* %1
%63 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.8, i64 0, i64 0), i32 %62)
store i32 4, i32* %4
%64 = load i32, i32* @SOL_SOCKET
%65 = load i32, i32* @SO_RCVBUF
%66 = call i32 @getsockopt(i32 %11, i32 %64, i32 %65, i32* %2, i32* %4)
%67 = icmp slt i32 %66, 0
br i1 %67, label %68, label %72
68: ; preds = %61
%69 = call i32 @perror(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
%70 = load i32, i32* @EXIT_FAILURE
%71 = call i32 @exit(i32 %70)
unreachable
72: ; preds = %61
%73 = load i32, i32* %2
%74 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.9, i64 0, i64 0), i32 %73)
store i32 4, i32* %4
%75 = load i32, i32* @SOL_SOCKET
%76 = load i32, i32* @SO_TYPE
%77 = call i32 @getsockopt(i32 %11, i32 %75, i32 %76, i32* %3, i32* %4)
%78 = icmp slt i32 %77, 0
br i1 %78, label %79, label %83
79: ; preds = %72
%80 = call i32 @perror(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
%81 = load i32, i32* @EXIT_FAILURE
%82 = call i32 @exit(i32 %81)
unreachable
83: ; preds = %72
%84 = load i32, i32* %3
%85 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.10, i64 0, i64 0), i32 %84)
%86 = call i32 @close(i32 %11)
ret i32 0
}