#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*/ UIM_DBG(char *);
int /*<<< orphan*/ UIM_ERR(char *);
int /*<<< orphan*/ UIM_VER(char *);
scalar_t__ system(char *);
int remove_modules() {
  int err = 0;
  UIM_VER(" Removing btwilink ");
  if (system("rmmod btwilink") != 0) {
    UIM_ERR(" Error removing btwilink module");
    err = -1;
  } else {
    UIM_DBG(" Removed btwilink module");
  }
  UIM_VER(" Removing fm_drv ");
  if (system("rmmod fm_drv") != 0) {
    UIM_ERR(" Error removing fm_drv module");
    err = -1;
  } else {
    UIM_DBG(" Removed fm_drv module ");
  }
  UIM_VER(" Removing st_drv ");
  if (system("rmmod st_drv") != 0) {
    UIM_ERR(" Error removing st_drv module");
    err = -1;
  } else {
    UIM_DBG(" Removed st_drv module ");
  }
  return err;
}


x86 assembly (clang, -O0):
<remove_modules>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
call   1050 <UIM_VER@plt>
lea    0xeb2(%rip),%rdi
call   1030 <system@plt>
cmp    $0x0,%rax
je     1189 <remove_modules+0x49>
lea    0xeab(%rip),%rdi
call   1040 <UIM_ERR@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1195 <remove_modules+0x55>
lea    0xeb3(%rip),%rdi
call   1060 <UIM_DBG@plt>
lea    0xec0(%rip),%rdi
call   1050 <UIM_VER@plt>
lea    0xec6(%rip),%rdi
call   1030 <system@plt>
cmp    $0x0,%rax
je     11cf <remove_modules+0x8f>
lea    0xebd(%rip),%rdi
call   1040 <UIM_ERR@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    11db <remove_modules+0x9b>
lea    0xec3(%rip),%rdi
call   1060 <UIM_DBG@plt>
lea    0xecf(%rip),%rdi
call   1050 <UIM_VER@plt>
lea    0xed5(%rip),%rdi
call   1030 <system@plt>
cmp    $0x0,%rax
je     1215 <remove_modules+0xd5>
lea    0xecc(%rip),%rdi
call   1040 <UIM_ERR@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1221 <remove_modules+0xe1>
lea    0xed2(%rip),%rdi
call   1060 <UIM_DBG@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_modules>:
push   %rbx
lea    0xeb8(%rip),%rdi
call   1050 <UIM_VER@plt>
lea    0xec0(%rip),%rdi
call   1030 <system@plt>
test   %rax,%rax
je     1171 <remove_modules+0x31>
lea    0xebe(%rip),%rdi
call   1040 <UIM_ERR@plt>
mov    $0xffffffff,%ebx
jmp    117f <remove_modules+0x3f>
lea    0xecb(%rip),%rdi
call   1060 <UIM_DBG@plt>
xor    %ebx,%ebx
lea    0xed6(%rip),%rdi
call   1050 <UIM_VER@plt>
lea    0xedc(%rip),%rdi
call   1030 <system@plt>
test   %rax,%rax
je     11af <remove_modules+0x6f>
lea    0xed8(%rip),%rdi
call   1040 <UIM_ERR@plt>
mov    $0xffffffff,%ebx
jmp    11bb <remove_modules+0x7b>
lea    0xee3(%rip),%rdi
call   1060 <UIM_DBG@plt>
lea    0xeef(%rip),%rdi
call   1050 <UIM_VER@plt>
lea    0xef5(%rip),%rdi
call   1030 <system@plt>
test   %rax,%rax
je     11eb <remove_modules+0xab>
lea    0xef1(%rip),%rdi
call   1040 <UIM_ERR@plt>
mov    $0xffffffff,%ebx
jmp    11f7 <remove_modules+0xb7>
lea    0xefc(%rip),%rdi
call   1060 <UIM_DBG@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [20 x i8] c" Removing btwilink \00"
@.str.1 = [15 x i8] c"rmmod btwilink\00"
@.str.2 = [32 x i8] c" Error removing btwilink module\00"
@.str.3 = [25 x i8] c" Removed btwilink module\00"
@.str.4 = [18 x i8] c" Removing fm_drv \00"
@.str.5 = [13 x i8] c"rmmod fm_drv\00"
@.str.6 = [30 x i8] c" Error removing fm_drv module\00"
@.str.7 = [24 x i8] c" Removed fm_drv module \00"
@.str.8 = [18 x i8] c" Removing st_drv \00"
@.str.9 = [13 x i8] c"rmmod st_drv\00"
@.str.10 = [30 x i8] c" Error removing st_drv module\00"
@.str.11 = [24 x i8] c" Removed st_drv module \00"
define i32 @remove_modules() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @UIM_VER(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%3 = call i64 @system(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @UIM_ERR(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0))
store i32 -1, i32* %1
br label %9
7: ; preds = %0
%8 = call i32 @UIM_DBG(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0))
br label %9
9: ; preds = %7, %5
%10 = call i32 @UIM_VER(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0))
%11 = call i64 @system(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0))
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %9
%14 = call i32 @UIM_ERR(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0))
store i32 -1, i32* %1
br label %17
15: ; preds = %9
%16 = call i32 @UIM_DBG(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.7, i64 0, i64 0))
br label %17
17: ; preds = %15, %13
%18 = call i32 @UIM_VER(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.8, i64 0, i64 0))
%19 = call i64 @system(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.9, i64 0, i64 0))
%20 = icmp ne i64 %19, 0
br i1 %20, label %21, label %23
21: ; preds = %17
%22 = call i32 @UIM_ERR(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.10, i64 0, i64 0))
store i32 -1, i32* %1
br label %25
23: ; preds = %17
%24 = call i32 @UIM_DBG(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.11, i64 0, i64 0))
br label %25
25: ; preds = %23, %21
%26 = load i32, i32* %1
ret i32 %26
}

LLVM IR (-O2):
@.str = [20 x i8] c" Removing btwilink \00"
@.str.1 = [15 x i8] c"rmmod btwilink\00"
@.str.2 = [32 x i8] c" Error removing btwilink module\00"
@.str.3 = [25 x i8] c" Removed btwilink module\00"
@.str.4 = [18 x i8] c" Removing fm_drv \00"
@.str.5 = [13 x i8] c"rmmod fm_drv\00"
@.str.6 = [30 x i8] c" Error removing fm_drv module\00"
@.str.7 = [24 x i8] c" Removed fm_drv module \00"
@.str.8 = [18 x i8] c" Removing st_drv \00"
@.str.9 = [13 x i8] c"rmmod st_drv\00"
@.str.10 = [30 x i8] c" Error removing st_drv module\00"
@.str.11 = [24 x i8] c" Removed st_drv module \00"
define i32 @remove_modules() {
%1 = tail call i32 @UIM_VER(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%2 = tail call i64 @system(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %0
%5 = tail call i32 @UIM_ERR(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0))
br label %8
6: ; preds = %0
%7 = tail call i32 @UIM_DBG(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0))
br label %8
8: ; preds = %6, %4
%9 = phi i32 [ -1, %4 ], [ 0, %6 ]
%10 = tail call i32 @UIM_VER(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0))
%11 = tail call i64 @system(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0))
%12 = icmp eq i64 %11, 0
br i1 %12, label %15, label %13
13: ; preds = %8
%14 = tail call i32 @UIM_ERR(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0))
br label %17
15: ; preds = %8
%16 = tail call i32 @UIM_DBG(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.7, i64 0, i64 0))
br label %17
17: ; preds = %15, %13
%18 = phi i32 [ -1, %13 ], [ %9, %15 ]
%19 = tail call i32 @UIM_VER(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.8, i64 0, i64 0))
%20 = tail call i64 @system(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.9, i64 0, i64 0))
%21 = icmp eq i64 %20, 0
br i1 %21, label %24, label %22
22: ; preds = %17
%23 = tail call i32 @UIM_ERR(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.10, i64 0, i64 0))
br label %26
24: ; preds = %17
%25 = tail call i32 @UIM_DBG(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.11, i64 0, i64 0))
br label %26
26: ; preds = %24, %22
%27 = phi i32 [ -1, %22 ], [ %18, %24 ]
ret i32 %27
}