#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*/ alcatel_attach();
int /*<<< orphan*/ alcatel_begin_transfer(unsigned char);
int /*<<< orphan*/ alcatel_close_session(unsigned char);
int /*<<< orphan*/ alcatel_commit(unsigned char);
int /*<<< orphan*/ alcatel_del_obj_list_items(unsigned char, unsigned char);
int /*<<< orphan*/ alcatel_detach();
scalar_t__ alcatel_select_type(unsigned char);
int /*<<< orphan*/ alcatel_start_session();
int /*<<< orphan*/ message(int, char *);
void del_alc_cats(unsigned char sync, unsigned char type, unsigned char cat) {
  alcatel_attach();
  alcatel_start_session();
  if (alcatel_select_type(type)) {
    alcatel_begin_transfer(sync);
    alcatel_del_obj_list_items(type, cat);
    alcatel_commit(type);
  } else {
    message(5, "Can not open sync session!");
  }
  alcatel_close_session(type);
  alcatel_detach();
}


x86 assembly (clang, -O0):
<del_alc_cats>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %sil,%cl
mov    %dil,%dl
mov    %dl,-0x1(%rbp)
mov    %cl,-0x2(%rbp)
mov    %al,-0x3(%rbp)
mov    $0x0,%al
call   10b0 <alcatel_attach@plt>
mov    $0x0,%al
call   1040 <alcatel_start_session@plt>
movzbl -0x2(%rbp),%edi
call   1070 <alcatel_select_type@plt>
cmp    $0x0,%rax
je     11f0 <del_alc_cats+0x60>
movzbl -0x1(%rbp),%edi
call   10a0 <alcatel_begin_transfer@plt>
mov    -0x2(%rbp),%al
movzbl %al,%edi
movzbl -0x3(%rbp),%esi
call   1080 <alcatel_del_obj_list_items@plt>
movzbl -0x2(%rbp),%edi
call   1060 <alcatel_commit@plt>
jmp    1201 <del_alc_cats+0x71>
mov    $0x5,%edi
lea    0xe04(%rip),%rsi
call   1030 <message@plt>
movzbl -0x2(%rbp),%edi
call   1090 <alcatel_close_session@plt>
mov    $0x0,%al
call   1050 <alcatel_detach@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<del_alc_cats>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
xor    %eax,%eax
call   10b0 <alcatel_attach@plt>
xor    %eax,%eax
call   1040 <alcatel_start_session@plt>
mov    %ebp,%edi
call   1070 <alcatel_select_type@plt>
movzbl %bpl,%ebp
test   %rax,%rax
je     11d5 <del_alc_cats+0x45>
movzbl %bl,%edi
call   10a0 <alcatel_begin_transfer@plt>
movzbl %r14b,%esi
mov    %ebp,%edi
call   1080 <alcatel_del_obj_list_items@plt>
mov    %ebp,%edi
call   1060 <alcatel_commit@plt>
jmp    11e6 <del_alc_cats+0x56>
lea    0xe24(%rip),%rsi
mov    $0x5,%edi
call   1030 <message@plt>
mov    %ebp,%edi
call   1090 <alcatel_close_session@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <alcatel_detach@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"Can not open sync session!\00"
define void @del_alc_cats(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8
store i8 %0, i8* %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%7 = call i32 (...) @alcatel_attach()
%8 = call i32 (...) @alcatel_start_session()
%9 = load i8, i8* %5
%10 = call i64 @alcatel_select_type(i8 zeroext %9)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %20
12: ; preds = %3
%13 = load i8, i8* %4
%14 = call i32 @alcatel_begin_transfer(i8 zeroext %13)
%15 = load i8, i8* %5
%16 = load i8, i8* %6
%17 = call i32 @alcatel_del_obj_list_items(i8 zeroext %15, i8 zeroext %16)
%18 = load i8, i8* %5
%19 = call i32 @alcatel_commit(i8 zeroext %18)
br label %22
20: ; preds = %3
%21 = call i32 @message(i32 5, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
br label %22
22: ; preds = %20, %12
%23 = load i8, i8* %5
%24 = call i32 @alcatel_close_session(i8 zeroext %23)
%25 = call i32 (...) @alcatel_detach()
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"Can not open sync session!\00"
define void @del_alc_cats(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2) {
%4 = tail call i32 (...) @alcatel_attach()
%5 = tail call i32 (...) @alcatel_start_session()
%6 = tail call i64 @alcatel_select_type(i8 zeroext %1)
%7 = icmp eq i64 %6, 0
br i1 %7, label %12, label %8
8: ; preds = %3
%9 = tail call i32 @alcatel_begin_transfer(i8 zeroext %0)
%10 = tail call i32 @alcatel_del_obj_list_items(i8 zeroext %1, i8 zeroext %2)
%11 = tail call i32 @alcatel_commit(i8 zeroext %1)
br label %14
12: ; preds = %3
%13 = tail call i32 @message(i32 5, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
br label %14
14: ; preds = %12, %8
%15 = tail call i32 @alcatel_close_session(i8 zeroext %1)
%16 = tail call i32 (...) @alcatel_detach()
ret void
}