#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 CDR_close();
int GPU_close();
int PAD_close();
int SPU_close();
int /*<<< orphan*/ SysMessage(char *);
void ClosePlugins() {
  int ret;
  ret = CDR_close();
  if (ret < 0) {
    SysMessage("Error Closing CDR Plugin");
    return;
  }
  ret = SPU_close();
  if (ret < 0) {
    SysMessage("Error Closing SPU Plugin");
    return;
  }
  ret = PAD_close();
  if (ret < 0) {
    SysMessage("Error Closing PAD Plugin");
    return;
  }
  ret = GPU_close();
  if (ret < 0) {
    SysMessage("Error Closing GPU Plugin");
    return;
  }
}


x86 assembly (clang, -O0):
<ClosePlugins>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <CDR_close@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    117d <ClosePlugins+0x2d>
lea    0xe8d(%rip),%rdi
call   1060 <SysMessage@plt>
jmp    11e7 <ClosePlugins+0x97>
mov    $0x0,%al
call   1040 <SPU_close@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    11a2 <ClosePlugins+0x52>
lea    0xe81(%rip),%rdi
call   1060 <SysMessage@plt>
jmp    11e7 <ClosePlugins+0x97>
mov    $0x0,%al
call   1030 <PAD_close@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    11c7 <ClosePlugins+0x77>
lea    0xe75(%rip),%rdi
call   1060 <SysMessage@plt>
jmp    11e7 <ClosePlugins+0x97>
mov    $0x0,%al
call   1070 <GPU_close@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    11e7 <ClosePlugins+0x97>
lea    0xe69(%rip),%rdi
call   1060 <SysMessage@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ClosePlugins>:
push   %rax
xor    %eax,%eax
call   1050 <CDR_close@plt>
test   %eax,%eax
js     117f <ClosePlugins+0x2f>
xor    %eax,%eax
call   1040 <SPU_close@plt>
test   %eax,%eax
js     118c <ClosePlugins+0x3c>
xor    %eax,%eax
call   1030 <PAD_close@plt>
test   %eax,%eax
js     1199 <ClosePlugins+0x49>
xor    %eax,%eax
call   1070 <GPU_close@plt>
test   %eax,%eax
js     11a6 <ClosePlugins+0x56>
pop    %rax
ret
lea    0xe7a(%rip),%rdi
pop    %rax
jmp    1060 <SysMessage@plt>
lea    0xe86(%rip),%rdi
pop    %rax
jmp    1060 <SysMessage@plt>
lea    0xe92(%rip),%rdi
pop    %rax
jmp    1060 <SysMessage@plt>
lea    0xe9e(%rip),%rdi
pop    %rax
jmp    1060 <SysMessage@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"Error Closing CDR Plugin\00"
@.str.1 = [25 x i8] c"Error Closing SPU Plugin\00"
@.str.2 = [25 x i8] c"Error Closing PAD Plugin\00"
@.str.3 = [25 x i8] c"Error Closing GPU Plugin\00"
define void @ClosePlugins() {
%1 = alloca i32
%2 = call i32 (...) @CDR_close()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @SysMessage(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %25
7: ; preds = %0
%8 = call i32 (...) @SPU_close()
store i32 %8, i32* %1
%9 = load i32, i32* %1
%10 = icmp slt i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %7
%12 = call i32 @SysMessage(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
br label %25
13: ; preds = %7
%14 = call i32 (...) @PAD_close()
store i32 %14, i32* %1
%15 = load i32, i32* %1
%16 = icmp slt i32 %15, 0
br i1 %16, label %17, label %19
17: ; preds = %13
%18 = call i32 @SysMessage(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
br label %25
19: ; preds = %13
%20 = call i32 (...) @GPU_close()
store i32 %20, i32* %1
%21 = load i32, i32* %1
%22 = icmp slt i32 %21, 0
br i1 %22, label %23, label %25
23: ; preds = %19
%24 = call i32 @SysMessage(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0))
br label %25
25: ; preds = %5, %11, %17, %23, %19
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"Error Closing CDR Plugin\00"
@.str.1 = [25 x i8] c"Error Closing SPU Plugin\00"
@.str.2 = [25 x i8] c"Error Closing PAD Plugin\00"
@.str.3 = [25 x i8] c"Error Closing GPU Plugin\00"
define void @ClosePlugins() {
%1 = tail call i32 (...) @CDR_close()
%2 = icmp slt i32 %1, 0
br i1 %2, label %12, label %3
3: ; preds = %0
%4 = tail call i32 (...) @SPU_close()
%5 = icmp slt i32 %4, 0
br i1 %5, label %12, label %6
6: ; preds = %3
%7 = tail call i32 (...) @PAD_close()
%8 = icmp slt i32 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %6
%10 = tail call i32 (...) @GPU_close()
%11 = icmp slt i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %9, %6, %3, %0
%13 = phi i8* [ getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), %0 ], [ getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), %3 ], [ getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), %6 ], [ getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0), %9 ]
%14 = tail call i32 @SysMessage(i8* %13)
br label %15
15: ; preds = %12, %9
ret void
}