#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 */

/* Variables and functions */
int /*<<< orphan*/ PF_INET;
int /*<<< orphan*/ PF_INET6;
int /*<<< orphan*/ PF_LOCAL;
int /*<<< orphan*/ SOCK_DGRAM;
int /*<<< orphan*/ SOCK_STREAM;
int /*<<< orphan*/ dotest(int /*<<< orphan*/, int /*<<< orphan*/,
                          int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  dotest(PF_INET, SOCK_DGRAM, 0);
  dotest(PF_INET, SOCK_STREAM, 0);
  dotest(PF_INET6, SOCK_DGRAM, 0);
  dotest(PF_INET6, SOCK_STREAM, 0);
  dotest(PF_LOCAL, SOCK_DGRAM, 0);
  dotest(PF_LOCAL, SOCK_STREAM, 0);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
mov    0x2eaa(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <dotest@plt>
mov    0x2e82(%rip),%rax
mov    (%rax),%edi
mov    0x2e81(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <dotest@plt>
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
mov    0x2e78(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <dotest@plt>
mov    0x2e70(%rip),%rax
mov    (%rax),%edi
mov    0x2e4f(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <dotest@plt>
mov    0x2e2f(%rip),%rax
mov    (%rax),%edi
mov    0x2e46(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <dotest@plt>
mov    0x2e16(%rip),%rax
mov    (%rax),%edi
mov    0x2e1d(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <dotest@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
mov    0x2eac(%rip),%rbx
mov    (%rbx),%edi
mov    0x2ebb(%rip),%r14
mov    (%r14),%esi
xor    %edx,%edx
call   1030 <dotest@plt>
mov    (%rbx),%edi
mov    0x2e98(%rip),%r15
mov    (%r15),%esi
xor    %edx,%edx
call   1030 <dotest@plt>
mov    0x2e9f(%rip),%rbx
mov    (%rbx),%edi
mov    (%r14),%esi
xor    %edx,%edx
call   1030 <dotest@plt>
mov    (%rbx),%edi
mov    (%r15),%esi
xor    %edx,%edx
call   1030 <dotest@plt>
mov    0x2e58(%rip),%rbx
mov    (%rbx),%edi
mov    (%r14),%esi
xor    %edx,%edx
call   1030 <dotest@plt>
mov    (%rbx),%edi
mov    (%r15),%esi
xor    %edx,%edx
call   1030 <dotest@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@PF_INET = global i32 0
@SOCK_DGRAM = global i32 0
@SOCK_STREAM = global i32 0
@PF_INET6 = global i32 0
@PF_LOCAL = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* @PF_INET
%7 = load i32, i32* @SOCK_DGRAM
%8 = call i32 @dotest(i32 %6, i32 %7, i32 0)
%9 = load i32, i32* @PF_INET
%10 = load i32, i32* @SOCK_STREAM
%11 = call i32 @dotest(i32 %9, i32 %10, i32 0)
%12 = load i32, i32* @PF_INET6
%13 = load i32, i32* @SOCK_DGRAM
%14 = call i32 @dotest(i32 %12, i32 %13, i32 0)
%15 = load i32, i32* @PF_INET6
%16 = load i32, i32* @SOCK_STREAM
%17 = call i32 @dotest(i32 %15, i32 %16, i32 0)
%18 = load i32, i32* @PF_LOCAL
%19 = load i32, i32* @SOCK_DGRAM
%20 = call i32 @dotest(i32 %18, i32 %19, i32 0)
%21 = load i32, i32* @PF_LOCAL
%22 = load i32, i32* @SOCK_STREAM
%23 = call i32 @dotest(i32 %21, i32 %22, i32 0)
ret i32 0
}

LLVM IR (-O2):
@PF_INET = global i32 0
@SOCK_DGRAM = global i32 0
@SOCK_STREAM = global i32 0
@PF_INET6 = global i32 0
@PF_LOCAL = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @PF_INET
%4 = load i32, i32* @SOCK_DGRAM
%5 = tail call i32 @dotest(i32 %3, i32 %4, i32 0)
%6 = load i32, i32* @PF_INET
%7 = load i32, i32* @SOCK_STREAM
%8 = tail call i32 @dotest(i32 %6, i32 %7, i32 0)
%9 = load i32, i32* @PF_INET6
%10 = load i32, i32* @SOCK_DGRAM
%11 = tail call i32 @dotest(i32 %9, i32 %10, i32 0)
%12 = load i32, i32* @PF_INET6
%13 = load i32, i32* @SOCK_STREAM
%14 = tail call i32 @dotest(i32 %12, i32 %13, i32 0)
%15 = load i32, i32* @PF_LOCAL
%16 = load i32, i32* @SOCK_DGRAM
%17 = tail call i32 @dotest(i32 %15, i32 %16, i32 0)
%18 = load i32, i32* @PF_LOCAL
%19 = load i32, i32* @SOCK_STREAM
%20 = tail call i32 @dotest(i32 %18, i32 %19, i32 0)
ret i32 0
}