#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 */
char *calloc(int, int);
int /*<<< orphan*/ strcat(char *, char *);
int strlen(char *);
char *Xorriso__hide_mode_text(int hide_mode, int flag) {
  char *acc = NULL;
  acc = calloc(1, 80);
  if (acc == NULL)
    return (NULL);
  acc[0] = 0;
  if (hide_mode == 0) {
    strcat(acc, "off:");
  } else if (hide_mode == 7) {
    strcat(acc, "on:");
  } else {
    if (hide_mode & 1)
      strcat(acc, "iso_rr:");
    if (hide_mode & 2)
      strcat(acc, "joliet:");
    if (hide_mode & 4)
      strcat(acc, "hfsplus:");
  }
  if (acc[0])
    acc[strlen(acc) - 1] = 0;
  return acc;
}


x86 assembly (clang, -O0):
<Xorriso__hide_mode_text>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    $0x1,%edi
mov    $0x50,%esi
call   1040 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1171 <Xorriso__hide_mode_text+0x41>
movq   $0x0,-0x8(%rbp)
jmp    1253 <Xorriso__hide_mode_text+0x123>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
cmpl   $0x0,-0xc(%rbp)
jne    1197 <Xorriso__hide_mode_text+0x67>
mov    -0x18(%rbp),%rdi
lea    0xe73(%rip),%rsi
call   1050 <strcat@plt>
jmp    121d <Xorriso__hide_mode_text+0xed>
cmpl   $0x7,-0xc(%rbp)
jne    11b6 <Xorriso__hide_mode_text+0x86>
mov    -0x18(%rbp),%rdi
lea    0xe59(%rip),%rsi
call   1050 <strcat@plt>
jmp    1218 <Xorriso__hide_mode_text+0xe8>
mov    -0xc(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     11d5 <Xorriso__hide_mode_text+0xa5>
mov    -0x18(%rbp),%rdi
lea    0xe39(%rip),%rsi
call   1050 <strcat@plt>
mov    -0xc(%rbp),%eax
and    $0x2,%eax
cmp    $0x0,%eax
je     11f4 <Xorriso__hide_mode_text+0xc4>
mov    -0x18(%rbp),%rdi
lea    0xe22(%rip),%rsi
call   1050 <strcat@plt>
mov    -0xc(%rbp),%eax
and    $0x4,%eax
cmp    $0x0,%eax
je     1213 <Xorriso__hide_mode_text+0xe3>
mov    -0x18(%rbp),%rdi
lea    0xe0b(%rip),%rsi
call   1050 <strcat@plt>
jmp    1218 <Xorriso__hide_mode_text+0xe8>
jmp    121d <Xorriso__hide_mode_text+0xed>
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     124b <Xorriso__hide_mode_text+0x11b>
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Xorriso__hide_mode_text>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
mov    $0x1,%edi
mov    $0x50,%esi
call   1040 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     118d <Xorriso__hide_mode_text+0x5d>
test   %ebp,%ebp
je     115e <Xorriso__hide_mode_text+0x2e>
cmp    $0x7,%ebp
jne    1167 <Xorriso__hide_mode_text+0x37>
lea    0xea9(%rip),%rsi
jmp    11c8 <Xorriso__hide_mode_text+0x98>
lea    0xe9b(%rip),%rsi
jmp    11c8 <Xorriso__hide_mode_text+0x98>
test   $0x1,%bpl
jne    1197 <Xorriso__hide_mode_text+0x67>
test   $0x2,%bpl
jne    11ac <Xorriso__hide_mode_text+0x7c>
test   $0x4,%bpl
jne    11c1 <Xorriso__hide_mode_text+0x91>
cmpb   $0x0,(%rbx)
je     118d <Xorriso__hide_mode_text+0x5d>
mov    %rbx,%rdi
call   1030 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%rbx,1)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
lea    0xe6b(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcat@plt>
test   $0x2,%bpl
je     1173 <Xorriso__hide_mode_text+0x43>
lea    0xe5e(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcat@plt>
test   $0x4,%bpl
je     1179 <Xorriso__hide_mode_text+0x49>
lea    0xe51(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcat@plt>
cmpb   $0x0,(%rbx)
jne    117e <Xorriso__hide_mode_text+0x4e>
jmp    118d <Xorriso__hide_mode_text+0x5d>

LLVM IR (-O0):
@.str = [5 x i8] c"off:\00"
@.str.1 = [4 x i8] c"on:\00"
@.str.2 = [8 x i8] c"iso_rr:\00"
@.str.3 = [8 x i8] c"joliet:\00"
@.str.4 = [9 x i8] c"hfsplus:\00"
define i8* @Xorriso__hide_mode_text(i32 %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* null, i8** %6
%7 = call i8* @calloc(i32 1, i32 80)
store i8* %7, i8** %6
%8 = load i8*, i8** %6
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %11
10: ; preds = %2
store i8* null, i8** %3
br label %62
11: ; preds = %2
%12 = load i8*, i8** %6
%13 = getelementptr inbounds i8, i8* %12, i64 0
store i8 0, i8* %13
%14 = load i32, i32* %4
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %19
16: ; preds = %11
%17 = load i8*, i8** %6
%18 = call i32 @strcat(i8* %17, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %48
19: ; preds = %11
%20 = load i32, i32* %4
%21 = icmp eq i32 %20, 7
br i1 %21, label %22, label %25
22: ; preds = %19
%23 = load i8*, i8** %6
%24 = call i32 @strcat(i8* %23, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %47
25: ; preds = %19
%26 = load i32, i32* %4
%27 = and i32 %26, 1
%28 = icmp ne i32 %27, 0
br i1 %28, label %29, label %32
29: ; preds = %25
%30 = load i8*, i8** %6
%31 = call i32 @strcat(i8* %30, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
br label %32
32: ; preds = %29, %25
%33 = load i32, i32* %4
%34 = and i32 %33, 2
%35 = icmp ne i32 %34, 0
br i1 %35, label %36, label %39
36: ; preds = %32
%37 = load i8*, i8** %6
%38 = call i32 @strcat(i8* %37, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
br label %39
39: ; preds = %36, %32
%40 = load i32, i32* %4
%41 = and i32 %40, 4
%42 = icmp ne i32 %41, 0
br i1 %42, label %43, label %46
43: ; preds = %39
%44 = load i8*, i8** %6
%45 = call i32 @strcat(i8* %44, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
br label %46
46: ; preds = %43, %39
br label %47
47: ; preds = %46, %22
br label %48
48: ; preds = %47, %16
%49 = load i8*, i8** %6
%50 = getelementptr inbounds i8, i8* %49, i64 0
%51 = load i8, i8* %50
%52 = icmp ne i8 %51, 0
br i1 %52, label %53, label %60
53: ; preds = %48
%54 = load i8*, i8** %6
%55 = load i8*, i8** %6
%56 = call i32 @strlen(i8* %55)
%57 = sub nsw i32 %56, 1
%58 = sext i32 %57 to i64
%59 = getelementptr inbounds i8, i8* %54, i64 %58
store i8 0, i8* %59
br label %60
60: ; preds = %53, %48
%61 = load i8*, i8** %6
store i8* %61, i8** %3
br label %62
62: ; preds = %60, %10
%63 = load i8*, i8** %3
ret i8* %63
}

LLVM IR (-O2):
@.str = [5 x i8] c"off:\00"
@.str.1 = [4 x i8] c"on:\00"
@.str.2 = [8 x i8] c"iso_rr:\00"
@.str.3 = [8 x i8] c"joliet:\00"
@.str.4 = [9 x i8] c"hfsplus:\00"
define i8* @Xorriso__hide_mode_text(i32 %0, i32 %1) {
%3 = tail call dereferenceable_or_null(80) i8* @calloc(i32 1, i32 80)
%4 = icmp eq i8* %3, null
br i1 %4, label %31, label %5
5: ; preds = %2
switch i32 %0, label %7 [
i32 0, label %20
i32 7, label %6
]
6: ; preds = %5
br label %20
7: ; preds = %5
%8 = and i32 %0, 1
%9 = icmp eq i32 %8, 0
br i1 %9, label %12, label %10
10: ; preds = %7
%11 = tail call i32 @strcat(i8* %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
br label %12
12: ; preds = %10, %7
%13 = and i32 %0, 2
%14 = icmp eq i32 %13, 0
br i1 %14, label %17, label %15
15: ; preds = %12
%16 = tail call i32 @strcat(i8* %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
br label %17
17: ; preds = %15, %12
%18 = and i32 %0, 4
%19 = icmp eq i32 %18, 0
br i1 %19, label %23, label %20
20: ; preds = %17, %5, %6
%21 = phi i8* [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), %6 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), %5 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), %17 ]
%22 = tail call i32 @strcat(i8* %3, i8* %21)
br label %23
23: ; preds = %20, %17
%24 = load i8, i8* %3
%25 = icmp eq i8 %24, 0
br i1 %25, label %31, label %26
26: ; preds = %23
%27 = tail call i32 @strlen(i8* %3)
%28 = add nsw i32 %27, -1
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds i8, i8* %3, i64 %29
store i8 0, i8* %30
br label %31
31: ; preds = %23, %26, %2
ret i8* %3
}