#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*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int sessions_import_data();
int /*<<< orphan*/ stderr;
void sessions_import(void) {
  fprintf(stderr, "loading sessions ... ");
  fflush(stderr);
  switch (sessions_import_data()) {
  case 0:
    fprintf(stderr, "file not found\n");
    fprintf(stderr, "if it is not fresh installation then you have to restart "
                    "all active mounts !!!\n");
    break;
  case 1:
    fprintf(stderr, "ok\n");
    fprintf(stderr, "sessions file has been loaded\n");
    break;
  default:
    fprintf(stderr, "error\n");
    fprintf(
        stderr,
        "due to missing sessions you have to restart all active mounts !!!\n");
    break;
  }
}


x86 assembly (clang, -O0):
<sessions_import>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea1(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    (%rax),%edi
lea    0xeb4(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
xor    %eax,%eax
call   1030 <sessions_import_data@plt>
mov    %eax,%ecx
mov    %ecx,-0x4(%rbp)
test   %eax,%eax
je     1186 <sessions_import+0x56>
jmp    1175 <sessions_import+0x45>
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
je     11b5 <sessions_import+0x85>
jmp    11e4 <sessions_import+0xb4>
mov    0x2e53(%rip),%rax
mov    (%rax),%edi
lea    0xe80(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e3e(%rip),%rax
mov    (%rax),%edi
lea    0xe7b(%rip),%rsi
call   1040 <fprintf@plt>
jmp    120e <sessions_import+0xde>
mov    0x2e24(%rip),%rax
mov    (%rax),%edi
lea    0xeb1(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e0f(%rip),%rax
mov    (%rax),%edi
lea    0xea0(%rip),%rsi
call   1040 <fprintf@plt>
jmp    120e <sessions_import+0xde>
mov    0x2df5(%rip),%rax
mov    (%rax),%edi
lea    0xea5(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2de0(%rip),%rax
mov    (%rax),%edi
lea    0xe97(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sessions_import>:
push   %r14
push   %rbx
push   %rax
mov    0x2ea5(%rip),%r14
mov    (%r14),%edi
lea    0xebb(%rip),%rsi
call   1040 <fprintf@plt>
mov    (%r14),%edi
call   1050 <fflush@plt>
xor    %eax,%eax
call   1030 <sessions_import_data@plt>
test   %eax,%eax
je     1172 <sessions_import+0x42>
cmp    $0x1,%eax
jne    1182 <sessions_import+0x52>
lea    0xf11(%rip),%rbx
lea    0xf06(%rip),%rsi
jmp    1190 <sessions_import+0x60>
lea    0xead(%rip),%rbx
lea    0xe96(%rip),%rsi
jmp    1190 <sessions_import+0x60>
lea    0xf17(%rip),%rbx
lea    0xf09(%rip),%rsi
mov    (%r14),%edi
call   1040 <fprintf@plt>
mov    (%r14),%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [22 x i8] c"loading sessions ... \00"
@.str.1 = [16 x i8] c"file not found\0A\00"
@.str.2 = [80 x i8] c"if it is not fresh installation then you have to restart all active mounts !!!\0A\00"
@.str.3 = [4 x i8] c"ok\0A\00"
@.str.4 = [31 x i8] c"sessions file has been loaded\0A\00"
@.str.5 = [7 x i8] c"error\0A\00"
@.str.6 = [67 x i8] c"due to missing sessions you have to restart all active mounts !!!\0A\00"
define void @sessions_import() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fflush(i32 %3)
%5 = call i32 (...) @sessions_import_data()
switch i32 %5, label %16 [
i32 0, label %6
i32 1, label %11
]
6: ; preds = %0
%7 = load i32, i32* @stderr
%8 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str.2, i64 0, i64 0))
br label %21
11: ; preds = %0
%12 = load i32, i32* @stderr
%13 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%14 = load i32, i32* @stderr
%15 = call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0))
br label %21
16: ; preds = %0
%17 = load i32, i32* @stderr
%18 = call i32 @fprintf(i32 %17, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
%19 = load i32, i32* @stderr
%20 = call i32 @fprintf(i32 %19, i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.6, i64 0, i64 0))
br label %21
21: ; preds = %16, %11, %6
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [22 x i8] c"loading sessions ... \00"
@.str.1 = [16 x i8] c"file not found\0A\00"
@.str.2 = [80 x i8] c"if it is not fresh installation then you have to restart all active mounts !!!\0A\00"
@.str.3 = [4 x i8] c"ok\0A\00"
@.str.4 = [31 x i8] c"sessions file has been loaded\0A\00"
@.str.5 = [7 x i8] c"error\0A\00"
@.str.6 = [67 x i8] c"due to missing sessions you have to restart all active mounts !!!\0A\00"
define void @sessions_import() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fflush(i32 %3)
%5 = tail call i32 (...) @sessions_import_data()
switch i32 %5, label %7 [
i32 0, label %8
i32 1, label %6
]
6: ; preds = %0
br label %8
7: ; preds = %0
br label %8
8: ; preds = %0, %7, %6
%9 = phi i8* [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), %7 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), %6 ], [ getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), %0 ]
%10 = phi i8* [ getelementptr inbounds ([67 x i8], [67 x i8]* @.str.6, i64 0, i64 0), %7 ], [ getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0), %6 ], [ getelementptr inbounds ([80 x i8], [80 x i8]* @.str.2, i64 0, i64 0), %0 ]
%11 = load i32, i32* @stderr
%12 = tail call i32 @fprintf(i32 %11, i8* %9)
%13 = load i32, i32* @stderr
%14 = tail call i32 @fprintf(i32 %13, i8* %10)
ret void
}