#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*/ dropbear_exit(char *, int);
const char *signkey_name_from_type(int type, int *namelen) {
  if (type == 1) {
    *namelen = 7;
    return "ssh-rsa";
  }
  if (type == 2) {
    *namelen = 7;
    return "ssh-dss";
  }
  dropbear_exit("Bad key type %d", type);
  return NULL;
}


x86 assembly (clang, -O0):
<signkey_name_from_type>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
cmpl   $0x1,-0xc(%rbp)
jne    1143 <signkey_name_from_type+0x33>
mov    -0x18(%rbp),%rax
movl   $0x7,(%rax)
lea    0xec6(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    117e <signkey_name_from_type+0x6e>
cmpl   $0x2,-0xc(%rbp)
jne    1167 <signkey_name_from_type+0x57>
mov    -0x18(%rbp),%rax
movl   $0x7,(%rax)
lea    0xeaa(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    117e <signkey_name_from_type+0x6e>
mov    -0xc(%rbp),%esi
lea    0xe9f(%rip),%rdi
call   1030 <dropbear_exit@plt>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<signkey_name_from_type>:
push   %rax
cmp    $0x2,%edi
je     112c <signkey_name_from_type+0x1c>
mov    %edi,%eax
cmp    $0x1,%edi
jne    113b <signkey_name_from_type+0x2b>
movl   $0x7,(%rsi)
lea    0xed6(%rip),%rax
pop    %rcx
ret
movl   $0x7,(%rsi)
lea    0xecf(%rip),%rax
pop    %rcx
ret
lea    0xece(%rip),%rdi
mov    %eax,%esi
call   1030 <dropbear_exit@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"ssh-rsa\00"
@.str.1 = [8 x i8] c"ssh-dss\00"
@.str.2 = [16 x i8] c"Bad key type %d\00"
define i8* @signkey_name_from_type(i32 %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32*
store i32 %0, i32* %4
store i32* %1, i32** %5
%6 = load i32, i32* %4
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32*, i32** %5
store i32 7, i32* %9
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8** %3
br label %18
10: ; preds = %2
%11 = load i32, i32* %4
%12 = icmp eq i32 %11, 2
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = load i32*, i32** %5
store i32 7, i32* %14
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8** %3
br label %18
15: ; preds = %10
%16 = load i32, i32* %4
%17 = call i32 @dropbear_exit(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %16)
store i8* null, i8** %3
br label %18
18: ; preds = %15, %13, %8
%19 = load i8*, i8** %3
ret i8* %19
}

LLVM IR (-O2):
@.str = [8 x i8] c"ssh-rsa\00"
@.str.1 = [8 x i8] c"ssh-dss\00"
@.str.2 = [16 x i8] c"Bad key type %d\00"
define i8* @signkey_name_from_type(i32 %0, i32* nocapture writeonly %1) {
switch i32 %0, label %5 [
i32 1, label %3
i32 2, label %4
]
3: ; preds = %2
store i32 7, i32* %1
br label %7
4: ; preds = %2
store i32 7, i32* %1
br label %7
5: ; preds = %2
%6 = tail call i32 @dropbear_exit(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %0)
br label %7
7: ; preds = %5, %4, %3
%8 = phi i8* [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), %3 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), %4 ], [ null, %5 ]
ret i8* %8
}