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

/* Variables and functions */
int /*<<< orphan*/ D2xx_CloseConfigFile(int /*<<< orphan*/ *);
int /*<<< orphan*/ *D2xx_OpenConfigFile();
int /*<<< orphan*/ D2xx_ReadTable(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                  int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ GetNumDefaultProductDescriptors();
int /*<<< orphan*/ GetProductDescriptorTable();
int /*<<< orphan*/ GetProductDescriptorTableSize();
void InitializeSystemIDs() {
  FILE *file = D2xx_OpenConfigFile();
  if (file != NULL) {
    D2xx_ReadTable(file, GetProductDescriptorTable(),
                   GetProductDescriptorTableSize(),
                   GetNumDefaultProductDescriptors());
    D2xx_CloseConfigFile(file);
  }
}


x86 assembly (clang, -O0):
<InitializeSystemIDs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x0,%al
call   1070 <D2xx_OpenConfigFile@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     11bb <InitializeSystemIDs+0x5b>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1060 <GetProductDescriptorTable@plt>
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <GetProductDescriptorTableSize@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1050 <GetNumDefaultProductDescriptors@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    %eax,%ecx
call   1040 <D2xx_ReadTable@plt>
mov    -0x8(%rbp),%rdi
call   1080 <D2xx_CloseConfigFile@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<InitializeSystemIDs>:
push   %rbp
push   %r14
push   %rbx
xor    %eax,%eax
call   1070 <D2xx_OpenConfigFile@plt>
test   %rax,%rax
je     11a8 <InitializeSystemIDs+0x48>
mov    %rax,%rbx
xor    %eax,%eax
call   1060 <GetProductDescriptorTable@plt>
mov    %eax,%r14d
xor    %eax,%eax
call   1030 <GetProductDescriptorTableSize@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1050 <GetNumDefaultProductDescriptors@plt>
mov    %rbx,%rdi
mov    %r14d,%esi
mov    %ebp,%edx
mov    %eax,%ecx
call   1040 <D2xx_ReadTable@plt>
mov    %rbx,%rdi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1080 <D2xx_CloseConfigFile@plt>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @InitializeSystemIDs() {
%1 = alloca i32*
%2 = call i32* (...) @D2xx_OpenConfigFile()
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = icmp ne i32* %3, null
br i1 %4, label %5, label %13
5: ; preds = %0
%6 = load i32*, i32** %1
%7 = call i32 (...) @GetProductDescriptorTable()
%8 = call i32 (...) @GetProductDescriptorTableSize()
%9 = call i32 (...) @GetNumDefaultProductDescriptors()
%10 = call i32 @D2xx_ReadTable(i32* %6, i32 %7, i32 %8, i32 %9)
%11 = load i32*, i32** %1
%12 = call i32 @D2xx_CloseConfigFile(i32* %11)
br label %13
13: ; preds = %5, %0
ret void
}

LLVM IR (-O2):
define void @InitializeSystemIDs() {
%1 = tail call i32* (...) @D2xx_OpenConfigFile()
%2 = icmp eq i32* %1, null
br i1 %2, label %9, label %3
3: ; preds = %0
%4 = tail call i32 (...) @GetProductDescriptorTable()
%5 = tail call i32 (...) @GetProductDescriptorTableSize()
%6 = tail call i32 (...) @GetNumDefaultProductDescriptors()
%7 = tail call i32 @D2xx_ReadTable(i32* %1, i32 %4, i32 %5, i32 %6)
%8 = tail call i32 @D2xx_CloseConfigFile(i32* %1)
br label %9
9: ; preds = %3, %0
ret void
}