#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 *, char *);
void kattach_init_sshkey(void) {
  char lcmd[255];
  sprintf(lcmd, "%s%s -t rsa -f %s%s", "/kaos/core/ssh/bin/", "dropbearkey",
          "/kaos/cfg/ssh/keys/", "rsa.key");
  kattach_sysexec(lcmd);
  sprintf(lcmd, "%s%s -t dss -f %s%s", "/kaos/core/ssh/bin/", "dropbearkey",
          "/kaos/cfg/ssh/keys/", "dss.key");
  kattach_sysexec(lcmd);
  return;
}


x86 assembly (clang, -O0):
<kattach_init_sshkey>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
lea    -0x100(%rbp),%rdi
lea    0xec7(%rip),%rsi
lea    0xed4(%rip),%rdx
lea    0xee1(%rip),%rcx
lea    0xee6(%rip),%r8
lea    0xef3(%rip),%r9
call   1040 <sprintf@plt>
lea    -0x100(%rbp),%rdi
call   1030 <kattach_sysexec@plt>
lea    -0x100(%rbp),%rdi
lea    0xedc(%rip),%rsi
lea    0xe99(%rip),%rdx
lea    0xea6(%rip),%rcx
lea    0xeab(%rip),%r8
lea    0xed4(%rip),%r9
call   1040 <sprintf@plt>
lea    -0x100(%rbp),%rdi
call   1030 <kattach_sysexec@plt>
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kattach_init_sshkey>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x108,%rsp
lea    0xecb(%rip),%rsi
lea    0xed8(%rip),%r12
lea    0xee5(%rip),%r14
lea    0xeea(%rip),%r15
lea    0xef7(%rip),%r9
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    %r12,%rdx
mov    %r14,%rcx
mov    %r15,%r8
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <kattach_sysexec@plt>
lea    0xedc(%rip),%rsi
lea    0xee9(%rip),%r9
mov    %rbx,%rdi
mov    %r12,%rdx
mov    %r14,%rcx
mov    %r15,%r8
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <kattach_sysexec@plt>
add    $0x108,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [20 x i8] c"%s%s -t rsa -f %s%s\00"
@.str.1 = [20 x i8] c"/kaos/core/ssh/bin/\00"
@.str.2 = [12 x i8] c"dropbearkey\00"
@.str.3 = [20 x i8] c"/kaos/cfg/ssh/keys/\00"
@.str.4 = [8 x i8] c"rsa.key\00"
@.str.5 = [20 x i8] c"%s%s -t dss -f %s%s\00"
@.str.6 = [8 x i8] c"dss.key\00"
define void @kattach_init_sshkey() {
%1 = alloca [255 x i8]
%2 = getelementptr inbounds [255 x i8], [255 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, 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 @sprintf(i8* %6, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, 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)
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"%s%s -t rsa -f %s%s\00"
@.str.1 = [20 x i8] c"/kaos/core/ssh/bin/\00"
@.str.2 = [12 x i8] c"dropbearkey\00"
@.str.3 = [20 x i8] c"/kaos/cfg/ssh/keys/\00"
@.str.4 = [8 x i8] c"rsa.key\00"
@.str.5 = [20 x i8] c"%s%s -t dss -f %s%s\00"
@.str.6 = [8 x i8] c"dss.key\00"
define void @kattach_init_sshkey() {
%1 = alloca [255 x i8]
%2 = getelementptr inbounds [255 x i8], [255 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0))
%4 = call i32 @kattach_sysexec(i8* %2)
%5 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0))
%6 = call i32 @kattach_sysexec(i8* %2)
ret void
}