#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*/ kattach_sysexec(char *);
int /*<<< orphan*/ sprintf(char *, char *, char *, char *, char *, ...);
int /*<<< orphan*/ sync();
void kattach_thedawn_cmfs(void) {
  char lcmd[255];
  sprintf(lcmd, "%s%s %s %s%s", "/kaos/core/squashfs/bin/", "mksquashfs",
          "/kaos/core/cmfs/", "/kaos/core/cmfi/", "2656d6d612b69616e1");
  kattach_sysexec(lcmd);
  sprintf(lcmd, "%s%s -rf %s*", "/kaos/core/busybox/bin/", "rm",
          "/kaos/core/cmfs/");
  kattach_sysexec(lcmd);
  sync();
  sprintf(lcmd, "%s%s %s%s %s -t %s -o loop=%s", "/kaos/core/busybox/bin/",
          "mount", "/kaos/core/cmfi/", "2656d6d612b69616e1", "/kaos/core/cmfs/",
          "squashfs", "/dev/loop0");
  kattach_sysexec(lcmd);
  return;
}


x86 assembly (clang, -O0):
<kattach_thedawn_cmfs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
lea    -0x100(%rbp),%rdi
lea    0xeb7(%rip),%rsi
lea    0xebd(%rip),%rdx
lea    0xecf(%rip),%rcx
lea    0xed3(%rip),%r8
lea    0xedd(%rip),%r9
lea    0xee7(%rip),%rax
mov    %rax,(%rsp)
mov    $0x0,%al
call   1050 <sprintf@plt>
lea    -0x100(%rbp),%rdi
call   1040 <kattach_sysexec@plt>
lea    -0x100(%rbp),%rdi
lea    0xed5(%rip),%rsi
lea    0xedb(%rip),%rdx
lea    0xeec(%rip),%rcx
lea    0xe8b(%rip),%r8
mov    $0x0,%al
call   1050 <sprintf@plt>
lea    -0x100(%rbp),%rdi
call   1040 <kattach_sysexec@plt>
mov    $0x0,%al
call   1030 <sync@plt>
lea    -0x100(%rbp),%rdi
lea    0xec0(%rip),%rsi
lea    0xe9e(%rip),%rdx
lea    0xed0(%rip),%rcx
lea    0xe5f(%rip),%r8
lea    0xe69(%rip),%r9
lea    0xe40(%rip),%r11
lea    0xe30(%rip),%r10
lea    0xeb3(%rip),%rax
mov    %r11,(%rsp)
mov    %r10,0x8(%rsp)
mov    %rax,0x10(%rsp)
mov    $0x0,%al
call   1050 <sprintf@plt>
lea    -0x100(%rbp),%rdi
call   1040 <kattach_sysexec@plt>
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kattach_thedawn_cmfs>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x100,%rsp
sub    $0x8,%rsp
lea    0xf08(%rip),%r15
lea    0xeae(%rip),%rsi
lea    0xeb4(%rip),%rdx
lea    0xec6(%rip),%rcx
lea    0xeca(%rip),%r14
lea    0xed4(%rip),%r12
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
mov    %r14,%r8
mov    %r12,%r9
xor    %eax,%eax
push   %r15
call   1050 <sprintf@plt>
add    $0x10,%rsp
mov    %rbx,%rdi
call   1040 <kattach_sysexec@plt>
lea    0xece(%rip),%rsi
lea    0xed4(%rip),%r13
lea    0xee5(%rip),%rcx
mov    %rbx,%rdi
mov    %r13,%rdx
mov    %r14,%r8
xor    %eax,%eax
call   1050 <sprintf@plt>
mov    %rbx,%rdi
call   1040 <kattach_sysexec@plt>
xor    %eax,%eax
call   1030 <sync@plt>
sub    $0x8,%rsp
lea    0xee2(%rip),%r10
lea    0xe51(%rip),%r11
lea    0xeb0(%rip),%rsi
lea    0xec7(%rip),%rcx
mov    %rbx,%rdi
mov    %r13,%rdx
mov    %r12,%r8
mov    %r15,%r9
xor    %eax,%eax
push   %r10
push   %r11
push   %r14
call   1050 <sprintf@plt>
add    $0x20,%rsp
mov    %rbx,%rdi
call   1040 <kattach_sysexec@plt>
add    $0x100,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [13 x i8] c"%s%s %s %s%s\00"
@.str.1 = [25 x i8] c"/kaos/core/squashfs/bin/\00"
@.str.2 = [11 x i8] c"mksquashfs\00"
@.str.3 = [17 x i8] c"/kaos/core/cmfs/\00"
@.str.4 = [17 x i8] c"/kaos/core/cmfi/\00"
@.str.5 = [19 x i8] c"2656d6d612b69616e1\00"
@.str.6 = [13 x i8] c"%s%s -rf %s*\00"
@.str.7 = [24 x i8] c"/kaos/core/busybox/bin/\00"
@.str.8 = [3 x i8] c"rm\00"
@.str.9 = [30 x i8] c"%s%s %s%s %s -t %s -o loop=%s\00"
@.str.10 = [6 x i8] c"mount\00"
@.str.11 = [9 x i8] c"squashfs\00"
@.str.12 = [11 x i8] c"/dev/loop0\00"
define void @kattach_thedawn_cmfs() {
%1 = alloca [255 x i8]
%2 = getelementptr inbounds [255 x i8], [255 x i8]* %1, i64 0, i64 0
%3 = call i32 (i8*, i8*, i8*, i8*, i8*, ...) @sprintf(i8* %2, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0))
%4 = getelementptr inbounds [255 x i8], [255 x i8]* %1, i64 0, i64 0
%5 = call i32 @kattach_sysexec(i8* %4)
%6 = getelementptr inbounds [255 x i8], [255 x i8]* %1, i64 0, i64 0
%7 = call i32 (i8*, i8*, i8*, i8*, i8*, ...) @sprintf(i8* %6, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0))
%8 = getelementptr inbounds [255 x i8], [255 x i8]* %1, i64 0, i64 0
%9 = call i32 @kattach_sysexec(i8* %8)
%10 = call i32 (...) @sync()
%11 = getelementptr inbounds [255 x i8], [255 x i8]* %1, i64 0, i64 0
%12 = call i32 (i8*, i8*, i8*, i8*, i8*, ...) @sprintf(i8* %11, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.12, i64 0, i64 0))
%13 = getelementptr inbounds [255 x i8], [255 x i8]* %1, i64 0, i64 0
%14 = call i32 @kattach_sysexec(i8* %13)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"%s%s %s %s%s\00"
@.str.1 = [25 x i8] c"/kaos/core/squashfs/bin/\00"
@.str.2 = [11 x i8] c"mksquashfs\00"
@.str.3 = [17 x i8] c"/kaos/core/cmfs/\00"
@.str.4 = [17 x i8] c"/kaos/core/cmfi/\00"
@.str.5 = [19 x i8] c"2656d6d612b69616e1\00"
@.str.6 = [13 x i8] c"%s%s -rf %s*\00"
@.str.7 = [24 x i8] c"/kaos/core/busybox/bin/\00"
@.str.8 = [3 x i8] c"rm\00"
@.str.9 = [30 x i8] c"%s%s %s%s %s -t %s -o loop=%s\00"
@.str.10 = [6 x i8] c"mount\00"
@.str.11 = [9 x i8] c"squashfs\00"
@.str.12 = [11 x i8] c"/dev/loop0\00"
define void @kattach_thedawn_cmfs() {
%1 = alloca [255 x i8]
%2 = getelementptr inbounds [255 x i8], [255 x i8]* %1, i64 0, i64 0
%3 = call i32 (i8*, i8*, i8*, i8*, i8*, ...) @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0))
%4 = call i32 @kattach_sysexec(i8* %2)
%5 = call i32 (i8*, i8*, i8*, i8*, i8*, ...) @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0))
%6 = call i32 @kattach_sysexec(i8* %2)
%7 = call i32 (...) @sync()
%8 = call i32 (i8*, i8*, i8*, i8*, i8*, ...) @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.12, i64 0, i64 0))
%9 = call i32 @kattach_sysexec(i8* %2)
ret void
}