#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*/ ClosePort(int, char const *);
int /*<<< orphan*/ close(int);
void DropConnection(int *DeviceFd, int *InSocketFd, int *OutSocketFd,
                    const char *LockFileName) {
  if (DeviceFd) {
    ClosePort(*DeviceFd, LockFileName);
  }
  if (InSocketFd) {
    close(*InSocketFd);
  }
  if (OutSocketFd) {
    close(*OutSocketFd);
  }
}


x86 assembly (clang, -O0):
<DropConnection>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1152 <DropConnection+0x32>
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x20(%rbp),%rsi
call   1030 <ClosePort@plt>
cmpq   $0x0,-0x10(%rbp)
je     1168 <DropConnection+0x48>
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
call   1040 <close@plt>
cmpq   $0x0,-0x18(%rbp)
je     117e <DropConnection+0x5e>
mov    -0x18(%rbp),%rax
mov    (%rax),%edi
call   1040 <close@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DropConnection>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
test   %rdi,%rdi
je     1139 <DropConnection+0x19>
mov    (%rdi),%edi
mov    %rcx,%rsi
call   1030 <ClosePort@plt>
test   %rbx,%rbx
je     1145 <DropConnection+0x25>
mov    (%rbx),%edi
call   1040 <close@plt>
test   %r14,%r14
je     1159 <DropConnection+0x39>
mov    (%r14),%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <close@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @DropConnection(i32* %0, i32* %1, i32* %2, i8* %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i8*
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i8* %3, i8** %8
%9 = load i32*, i32** %5
%10 = icmp ne i32* %9, null
br i1 %10, label %11, label %16
11: ; preds = %4
%12 = load i32*, i32** %5
%13 = load i32, i32* %12
%14 = load i8*, i8** %8
%15 = call i32 @ClosePort(i32 %13, i8* %14)
br label %16
16: ; preds = %11, %4
%17 = load i32*, i32** %6
%18 = icmp ne i32* %17, null
br i1 %18, label %19, label %23
19: ; preds = %16
%20 = load i32*, i32** %6
%21 = load i32, i32* %20
%22 = call i32 @close(i32 %21)
br label %23
23: ; preds = %19, %16
%24 = load i32*, i32** %7
%25 = icmp ne i32* %24, null
br i1 %25, label %26, label %30
26: ; preds = %23
%27 = load i32*, i32** %7
%28 = load i32, i32* %27
%29 = call i32 @close(i32 %28)
br label %30
30: ; preds = %26, %23
ret void
}

LLVM IR (-O2):
define void @DropConnection(i32* %0, i32* %1, i32* %2, i8* %3) {
%5 = icmp eq i32* %0, null
br i1 %5, label %9, label %6
6: ; preds = %4
%7 = load i32, i32* %0
%8 = tail call i32 @ClosePort(i32 %7, i8* %3)
br label %9
9: ; preds = %6, %4
%10 = icmp eq i32* %1, null
br i1 %10, label %14, label %11
11: ; preds = %9
%12 = load i32, i32* %1
%13 = tail call i32 @close(i32 %12)
br label %14
14: ; preds = %11, %9
%15 = icmp eq i32* %2, null
br i1 %15, label %19, label %16
16: ; preds = %14
%17 = load i32, i32* %2
%18 = tail call i32 @close(i32 %17)
br label %19
19: ; preds = %16, %14
ret void
}