#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 /*<<< orphan*/ socket_num2;
typedef int /*<<< orphan*/ socket_num;
typedef int /*<<< orphan*/ socket_add;

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int EXIT_SUCCESS;
int /*<<< orphan*/ SOCK_STREAM;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ shutdown(int, int /*<<< orphan*/);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int main(int argc, char *argv[]) {
  int socket_num;
  int *socket_add;
  unsigned socket_num2;
  fprintf(stderr, "%d\n", sizeof(socket_num));
  fprintf(stderr, "%d\n", sizeof(socket_add));
  fprintf(stderr, "%d\n", sizeof(socket_num2));
  socket_num = socket(AF_INET, SOCK_STREAM, 0);
  fprintf(stderr, "%d\n", socket_num);
  shutdown(socket_num, 0);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
lea    0xeaa(%rip),%rsi
mov    $0x4,%edx
call   1040 <fprintf@plt>
mov    0x2e71(%rip),%rax
mov    (%rax),%edi
lea    0xe90(%rip),%rsi
mov    $0x8,%edx
call   1040 <fprintf@plt>
mov    0x2e57(%rip),%rax
mov    (%rax),%edi
lea    0xe76(%rip),%rsi
mov    $0x4,%edx
call   1040 <fprintf@plt>
mov    0x2e4d(%rip),%rax
mov    (%rax),%edi
mov    0x2e2c(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1050 <socket@plt>
mov    %eax,-0x14(%rbp)
mov    0x2e21(%rip),%rax
mov    (%rax),%edi
mov    -0x14(%rbp),%edx
lea    0xe3d(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x14(%rbp),%edi
xor    %esi,%esi
call   1030 <shutdown@plt>
mov    0x2def(%rip),%rax
mov    (%rax),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    0x2e9d(%rip),%r14
mov    (%r14),%edi
lea    0xebb(%rip),%rbx
mov    %rbx,%rsi
mov    $0x4,%edx
call   1040 <fprintf@plt>
mov    (%r14),%edi
mov    %rbx,%rsi
mov    $0x8,%edx
call   1040 <fprintf@plt>
mov    (%r14),%edi
mov    %rbx,%rsi
mov    $0x4,%edx
call   1040 <fprintf@plt>
mov    0x2e6f(%rip),%rax
mov    (%rax),%edi
mov    0x2e4e(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1050 <socket@plt>
mov    %eax,%ebp
mov    (%r14),%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1040 <fprintf@plt>
mov    %ebp,%edi
xor    %esi,%esi
call   1030 <shutdown@plt>
mov    0x2e1e(%rip),%rax
mov    (%rax),%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"%d\0A\00"
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 4)
%11 = load i32, i32* @stderr
%12 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 8)
%13 = load i32, i32* @stderr
%14 = call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 4)
%15 = load i32, i32* @AF_INET
%16 = load i32, i32* @SOCK_STREAM
%17 = call i32 @socket(i32 %15, i32 %16, i32 0)
store i32 %17, i32* %6
%18 = load i32, i32* @stderr
%19 = load i32, i32* %6
%20 = call i32 @fprintf(i32 %18, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %19)
%21 = load i32, i32* %6
%22 = call i32 @shutdown(i32 %21, i32 0)
%23 = load i32, i32* @EXIT_SUCCESS
ret i32 %23
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%d\0A\00"
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 4)
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 8)
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 4)
%9 = load i32, i32* @AF_INET
%10 = load i32, i32* @SOCK_STREAM
%11 = tail call i32 @socket(i32 %9, i32 %10, i32 0)
%12 = load i32, i32* @stderr
%13 = tail call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %11)
%14 = tail call i32 @shutdown(i32 %11, i32 0)
%15 = load i32, i32* @EXIT_SUCCESS
ret i32 %15
}