#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 aaip_set_attr_list(char *, size_t, char **, size_t *, char **, int);
int iso_local_set_attrs(char *disk_path, size_t num_attrs, char **names,
                        size_t *value_lengths, char **values, int flag) {
  int ret;
  ret = aaip_set_attr_list(disk_path, num_attrs, names, value_lengths, values,
                           (flag & (8 | 32 | 64)) | !(flag & 1));
  if (ret <= 0) {
    if (ret == -1)
      return 0xF030FFFA;
    if (ret == -2)
      return 0xE830FEAC;
    if (ret >= -5)
      return 0xE830FEAA;
    if (ret == -6 || ret == -7)
      return 0xE830FEAD;
    if (ret == -8)
      return 0xE830FE84;
    return ret;
  }
  return 1;
}


x86 assembly (clang, -O0):
<iso_local_set_attrs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    %r9d,-0x34(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    -0x30(%rbp),%r8
mov    -0x34(%rbp),%r9d
and    $0x68,%r9d
mov    -0x34(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
or     %eax,%r9d
call   1030 <aaip_set_attr_list@plt>
mov    %eax,-0x38(%rbp)
cmpl   $0x0,-0x38(%rbp)
jg     11f7 <iso_local_set_attrs+0xe7>
cmpl   $0xffffffff,-0x38(%rbp)
jne    118a <iso_local_set_attrs+0x7a>
movl   $0xf030fffa,-0x4(%rbp)
jmp    11fe <iso_local_set_attrs+0xee>
cmpl   $0xfffffffe,-0x38(%rbp)
jne    11a0 <iso_local_set_attrs+0x90>
movl   $0xe830feac,-0x4(%rbp)
jmp    11fe <iso_local_set_attrs+0xee>
cmpl   $0xfffffffb,-0x38(%rbp)
jl     11b6 <iso_local_set_attrs+0xa6>
movl   $0xe830feaa,-0x4(%rbp)
jmp    11fe <iso_local_set_attrs+0xee>
cmpl   $0xfffffffa,-0x38(%rbp)
je     11ca <iso_local_set_attrs+0xba>
cmpl   $0xfffffff9,-0x38(%rbp)
jne    11d6 <iso_local_set_attrs+0xc6>
movl   $0xe830fead,-0x4(%rbp)
jmp    11fe <iso_local_set_attrs+0xee>
cmpl   $0xfffffff8,-0x38(%rbp)
jne    11ec <iso_local_set_attrs+0xdc>
movl   $0xe830fe84,-0x4(%rbp)
jmp    11fe <iso_local_set_attrs+0xee>
mov    -0x38(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    11fe <iso_local_set_attrs+0xee>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iso_local_set_attrs>:
push   %rax
and    $0x69,%r9d
xor    $0x1,%r9d
call   1030 <aaip_set_attr_list@plt>
mov    $0x1,%ecx
test   %eax,%eax
jle    112b <iso_local_set_attrs+0x1b>
mov    %ecx,%eax
pop    %rcx
ret
cmp    $0xffffffff,%eax
je     113c <iso_local_set_attrs+0x2c>
cmp    $0xfffffffe,%eax
jne    1143 <iso_local_set_attrs+0x33>
mov    $0xe830feac,%ecx
jmp    1127 <iso_local_set_attrs+0x17>
mov    $0xf030fffa,%ecx
jmp    1127 <iso_local_set_attrs+0x17>
mov    $0xe830feaa,%ecx
cmp    $0xfffffffa,%eax
jg     1127 <iso_local_set_attrs+0x17>
lea    0x7(%rax),%edx
mov    $0xe830fead,%ecx
cmp    $0x2,%edx
jb     1127 <iso_local_set_attrs+0x17>
cmp    $0xfffffff8,%eax
mov    $0xe830fe84,%ecx
cmovne %eax,%ecx
jmp    1127 <iso_local_set_attrs+0x17>

LLVM IR (-O0):
define i32 @iso_local_set_attrs(i8* %0, i64 %1, i8** %2, i64* %3, i8** %4, i32 %5) {
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i64
%10 = alloca i8**
%11 = alloca i64*
%12 = alloca i8**
%13 = alloca i32
%14 = alloca i32
store i8* %0, i8** %8
store i64 %1, i64* %9
store i8** %2, i8*** %10
store i64* %3, i64** %11
store i8** %4, i8*** %12
store i32 %5, i32* %13
%15 = load i8*, i8** %8
%16 = load i64, i64* %9
%17 = load i8**, i8*** %10
%18 = load i64*, i64** %11
%19 = load i8**, i8*** %12
%20 = load i32, i32* %13
%21 = and i32 %20, 104
%22 = load i32, i32* %13
%23 = and i32 %22, 1
%24 = icmp ne i32 %23, 0
%25 = xor i1 %24, true
%26 = zext i1 %25 to i32
%27 = or i32 %21, %26
%28 = call i32 @aaip_set_attr_list(i8* %15, i64 %16, i8** %17, i64* %18, i8** %19, i32 %27)
store i32 %28, i32* %14
%29 = load i32, i32* %14
%30 = icmp sle i32 %29, 0
br i1 %30, label %31, label %56
31: ; preds = %6
%32 = load i32, i32* %14
%33 = icmp eq i32 %32, -1
br i1 %33, label %34, label %35
34: ; preds = %31
store i32 -265224198, i32* %7
br label %57
35: ; preds = %31
%36 = load i32, i32* %14
%37 = icmp eq i32 %36, -2
br i1 %37, label %38, label %39
38: ; preds = %35
store i32 -399442260, i32* %7
br label %57
39: ; preds = %35
%40 = load i32, i32* %14
%41 = icmp sge i32 %40, -5
br i1 %41, label %42, label %43
42: ; preds = %39
store i32 -399442262, i32* %7
br label %57
43: ; preds = %39
%44 = load i32, i32* %14
%45 = icmp eq i32 %44, -6
br i1 %45, label %49, label %46
46: ; preds = %43
%47 = load i32, i32* %14
%48 = icmp eq i32 %47, -7
br i1 %48, label %49, label %50
49: ; preds = %46, %43
store i32 -399442259, i32* %7
br label %57
50: ; preds = %46
%51 = load i32, i32* %14
%52 = icmp eq i32 %51, -8
br i1 %52, label %53, label %54
53: ; preds = %50
store i32 -399442300, i32* %7
br label %57
54: ; preds = %50
%55 = load i32, i32* %14
store i32 %55, i32* %7
br label %57
56: ; preds = %6
store i32 1, i32* %7
br label %57
57: ; preds = %56, %54, %53, %49, %42, %38, %34
%58 = load i32, i32* %7
ret i32 %58
}

LLVM IR (-O2):
define i32 @iso_local_set_attrs(i8* %0, i64 %1, i8** %2, i64* %3, i8** %4, i32 %5) {
%7 = and i32 %5, 105
%8 = xor i32 %7, 1
%9 = tail call i32 @aaip_set_attr_list(i8* %0, i64 %1, i8** %2, i64* %3, i8** %4, i32 %8)
%10 = icmp slt i32 %9, 1
br i1 %10, label %11, label %21
11: ; preds = %6
switch i32 %9, label %13 [
i32 -1, label %21
i32 -2, label %12
]
12: ; preds = %11
br label %21
13: ; preds = %11
%14 = icmp sgt i32 %9, -6
br i1 %14, label %21, label %15
15: ; preds = %13
%16 = add nsw i32 %9, 7
%17 = icmp ult i32 %16, 2
br i1 %17, label %21, label %18
18: ; preds = %15
%19 = icmp eq i32 %9, -8
%20 = select i1 %19, i32 -399442300, i32 %9
br label %21
21: ; preds = %6, %18, %15, %13, %11, %12
%22 = phi i32 [ -399442260, %12 ], [ -265224198, %11 ], [ -399442262, %13 ], [ -399442259, %15 ], [ %20, %18 ], [ 1, %6 ]
ret i32 %22
}