#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*/ abms_system(char *);
int /*<<< orphan*/ sprintf(char *, char *, char *, char *, char *, ...);
void sqfs_gen(void) {
  char lcmd[255];
  sprintf(lcmd, "%s%s %s", "/app/os/sys/bin/", "mkdir", "/app/os/images/");
  abms_system(lcmd);
  sprintf(lcmd, "%s%s %s %s%s", "/app/os/sys/bin/", "mksquashfs",
          "/app/os/sys/", "/app/os/images/", "abms.sqfs");
  abms_system(lcmd);
  return;
}


x86 assembly (clang, -O0):
<sqfs_gen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
lea    -0x100(%rbp),%rdi
lea    0xec7(%rip),%rsi
lea    0xec8(%rip),%rdx
lea    0xed2(%rip),%rcx
lea    0xed1(%rip),%r8
mov    $0x0,%al
call   1040 <sprintf@plt>
lea    -0x100(%rbp),%rdi
call   1030 <abms_system@plt>
lea    -0x100(%rbp),%rdi
lea    0xec0(%rip),%rsi
lea    0xe92(%rip),%rdx
lea    0xebf(%rip),%rcx
lea    0xec3(%rip),%r8
lea    0xe94(%rip),%r9
lea    0xec2(%rip),%rax
mov    %rax,(%rsp)
mov    $0x0,%al
call   1040 <sprintf@plt>
lea    -0x100(%rbp),%rdi
call   1030 <abms_system@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqfs_gen>:
push   %r15
push   %r14
push   %rbx
sub    $0x110,%rsp
lea    0xecd(%rip),%rsi
lea    0xece(%rip),%r15
lea    0xed8(%rip),%rcx
lea    0xed7(%rip),%r14
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    %r15,%rdx
mov    %r14,%r8
xor    %eax,%eax
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <abms_system@plt>
lea    0xee8(%rip),%rax
mov    %rax,(%rsp)
lea    0xeb8(%rip),%rsi
lea    0xebe(%rip),%rcx
lea    0xec2(%rip),%r8
mov    %rbx,%rdi
mov    %r15,%rdx
mov    %r14,%r9
xor    %eax,%eax
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <abms_system@plt>
add    $0x110,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [8 x i8] c"%s%s %s\00"
@.str.1 = [17 x i8] c"/app/os/sys/bin/\00"
@.str.2 = [6 x i8] c"mkdir\00"
@.str.3 = [16 x i8] c"/app/os/images/\00"
@.str.4 = [13 x i8] c"%s%s %s %s%s\00"
@.str.5 = [11 x i8] c"mksquashfs\00"
@.str.6 = [13 x i8] c"/app/os/sys/\00"
@.str.7 = [10 x i8] c"abms.sqfs\00"
define void @sqfs_gen() {
%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 ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0))
%4 = getelementptr inbounds [255 x i8], [255 x i8]* %1, i64 0, i64 0
%5 = call i32 @abms_system(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.4, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0))
%8 = getelementptr inbounds [255 x i8], [255 x i8]* %1, i64 0, i64 0
%9 = call i32 @abms_system(i8* %8)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"%s%s %s\00"
@.str.1 = [17 x i8] c"/app/os/sys/bin/\00"
@.str.2 = [6 x i8] c"mkdir\00"
@.str.3 = [16 x i8] c"/app/os/images/\00"
@.str.4 = [13 x i8] c"%s%s %s %s%s\00"
@.str.5 = [11 x i8] c"mksquashfs\00"
@.str.6 = [13 x i8] c"/app/os/sys/\00"
@.str.7 = [10 x i8] c"abms.sqfs\00"
define void @sqfs_gen() {
%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 ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0))
%4 = call i32 @abms_system(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.4, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0))
%6 = call i32 @abms_system(i8* %2)
ret void
}