#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 *, ...);
void sshd_init(void) {
  char lcmd[255];
  sprintf(lcmd, "%s%s /app/os/sys/sshd/keys -p", "/app/os/sys/bin/", "mkdir");
  abms_system(lcmd);
  sprintf(lcmd, "%s -t rsa -f %s", "/app/os/sys/sshd/bin/dropbearkey",
          "/app/os/sys/sshd/keys/rsa.key");
  abms_system(lcmd);
  sprintf(lcmd, "%s -r %s -p %d -E", "/app/os/sys/sshd/sbin/dropbear",
          "/app/os/sys/sshd/keys/rsa.key", 1103);
  abms_system(lcmd);
  return;
}


x86 assembly (clang, -O0):
<sshd_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
lea    -0x100(%rbp),%rdi
lea    0xec7(%rip),%rsi
lea    0xede(%rip),%rdx
lea    0xee8(%rip),%rcx
mov    $0x0,%al
call   1040 <sprintf@plt>
lea    -0x100(%rbp),%rdi
call   1030 <abms_system@plt>
lea    -0x100(%rbp),%rdi
lea    0xecd(%rip),%rsi
lea    0xed6(%rip),%rdx
lea    0xef0(%rip),%rcx
mov    $0x0,%al
call   1040 <sprintf@plt>
lea    -0x100(%rbp),%rdi
call   1030 <abms_system@plt>
lea    -0x100(%rbp),%rdi
lea    0xeed(%rip),%rsi
lea    0xef8(%rip),%rdx
lea    0xec1(%rip),%rcx
mov    $0x44f,%r8d
mov    $0x0,%al
call   1040 <sprintf@plt>
lea    -0x100(%rbp),%rdi
call   1030 <abms_system@plt>
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sshd_init>:
push   %r14
push   %rbx
sub    $0x108,%rsp
lea    0xecf(%rip),%rsi
lea    0xee6(%rip),%rdx
lea    0xef0(%rip),%rcx
mov    %rsp,%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <abms_system@plt>
lea    0xeda(%rip),%rsi
lea    0xee3(%rip),%rdx
lea    0xefd(%rip),%r14
mov    %rbx,%rdi
mov    %r14,%rcx
xor    %eax,%eax
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <abms_system@plt>
lea    0xeff(%rip),%rsi
lea    0xf0a(%rip),%rdx
mov    %rbx,%rdi
mov    %r14,%rcx
mov    $0x44f,%r8d
xor    %eax,%eax
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <abms_system@plt>
add    $0x108,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [30 x i8] c"%s%s /app/os/sys/sshd/keys -p\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"%s -t rsa -f %s\00"
@.str.4 = [33 x i8] c"/app/os/sys/sshd/bin/dropbearkey\00"
@.str.5 = [30 x i8] c"/app/os/sys/sshd/keys/rsa.key\00"
@.str.6 = [18 x i8] c"%s -r %s -p %d -E\00"
@.str.7 = [31 x i8] c"/app/os/sys/sshd/sbin/dropbear\00"
define void @sshd_init() {
%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*, ...) @sprintf(i8* %2, i8* getelementptr inbounds ([30 x i8], [30 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))
%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*, ...) @sprintf(i8* %6, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.5, 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)
%10 = getelementptr inbounds [255 x i8], [255 x i8]* %1, i64 0, i64 0
%11 = call i32 (i8*, i8*, i8*, i8*, ...) @sprintf(i8* %10, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.5, i64 0, i64 0), i32 1103)
%12 = getelementptr inbounds [255 x i8], [255 x i8]* %1, i64 0, i64 0
%13 = call i32 @abms_system(i8* %12)
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"%s%s /app/os/sys/sshd/keys -p\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"%s -t rsa -f %s\00"
@.str.4 = [33 x i8] c"/app/os/sys/sshd/bin/dropbearkey\00"
@.str.5 = [30 x i8] c"/app/os/sys/sshd/keys/rsa.key\00"
@.str.6 = [18 x i8] c"%s -r %s -p %d -E\00"
@.str.7 = [31 x i8] c"/app/os/sys/sshd/sbin/dropbear\00"
define void @sshd_init() {
%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*, ...) @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 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))
%4 = call i32 @abms_system(i8* %2)
%5 = call i32 (i8*, i8*, i8*, i8*, ...) @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.5, i64 0, i64 0))
%6 = call i32 @abms_system(i8* %2)
%7 = call i32 (i8*, i8*, i8*, i8*, ...) @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.5, i64 0, i64 0), i32 1103)
%8 = call i32 @abms_system(i8* %2)
ret void
}