#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 */
typedef scalar_t__ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ cli_putc(char);
int /*<<< orphan*/ cli_putstr(char const *);
scalar_t__ strlen(char const *);
int /*<<< orphan*/ ustoa(scalar_t__, char *, int);
void nessie_print_header(const char *name, uint16_t keysize_b,
                         uint16_t blocksize_b, uint16_t hashsize_b,
                         uint16_t macsize_b, uint16_t ivsize_b) {
  uint16_t i;
  cli_putstr("\r\n\r\n"
             "*****************************************************************"
             "***************\r\n"
             "* ARM-Crypto-Lib - crypto primitives for ARM microcontrollers by "
             "Daniel Otte   *\r\n"
             "*****************************************************************"
             "***************\r\n"
             "\r\n");
  cli_putstr("Primitive Name: ");
  cli_putstr(name);
  cli_putstr("\r\n");
  for (i = 0; i < 16 + strlen(name); ++i) {
    cli_putc('=');
  }
  char str[6];
  if (keysize_b) {
    cli_putstr("\r\nKey size: ");
    ustoa(keysize_b, str, 10);
    cli_putstr(str);
    cli_putstr(" bits");
  }
  if (blocksize_b) {
    cli_putstr("\r\nBlock size: ");
    ustoa(blocksize_b, str, 10);
    cli_putstr(str);
    cli_putstr(" bits");
  }
  if (hashsize_b) {
    cli_putstr("\r\nHash size: ");
    ustoa(hashsize_b, str, 10);
    cli_putstr(str);
    cli_putstr(" bits");
  }
  if (macsize_b) {
    cli_putstr("\r\nMac size: ");
    ustoa(macsize_b, str, 10);
    cli_putstr(str);
    cli_putstr(" bits");
  }
  if (ivsize_b) {
    if (ivsize_b == (uint16_t)-1) {
      cli_putstr("\r\nNo initial value (IV) mode");
    } else {
      cli_putstr("\r\nIV size: ");
      ustoa(ivsize_b, str, 10);
      cli_putstr(str);
      cli_putstr(" bits");
    }
  }
  cli_putstr("\r\n");
}


x86 assembly (clang, -O0):
<nessie_print_header>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
lea    0xe99(%rip),%rdi
call   1040 <cli_putstr@plt>
lea    0xf8a(%rip),%rdi
call   1040 <cli_putstr@plt>
mov    -0x8(%rbp),%rdi
call   1040 <cli_putstr@plt>
lea    0xf72(%rip),%rdi
call   1040 <cli_putstr@plt>
movq   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <strlen@plt>
mov    %rax,%rcx
mov    -0x48(%rbp),%rax
add    $0x10,%rcx
cmp    %rcx,%rax
jge    11d5 <nessie_print_header+0x95>
mov    $0x3d,%edi
call   1030 <cli_putc@plt>
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
jmp    1195 <nessie_print_header+0x55>
cmpq   $0x0,-0x10(%rbp)
je     1213 <nessie_print_header+0xd3>
lea    0xf27(%rip),%rdi
call   1040 <cli_putstr@plt>
mov    -0x10(%rbp),%rdi
lea    -0x3e(%rbp),%rsi
mov    $0xa,%edx
call   1060 <ustoa@plt>
lea    -0x3e(%rbp),%rdi
call   1040 <cli_putstr@plt>
lea    0xf0d(%rip),%rdi
call   1040 <cli_putstr@plt>
cmpq   $0x0,-0x18(%rbp)
je     1251 <nessie_print_header+0x111>
lea    0xefc(%rip),%rdi
call   1040 <cli_putstr@plt>
mov    -0x18(%rbp),%rdi
lea    -0x3e(%rbp),%rsi
mov    $0xa,%edx
call   1060 <ustoa@plt>
lea    -0x3e(%rbp),%rdi
call   1040 <cli_putstr@plt>
lea    0xecf(%rip),%rdi
call   1040 <cli_putstr@plt>
cmpq   $0x0,-0x20(%rbp)
je     128f <nessie_print_header+0x14f>
lea    0xecd(%rip),%rdi
call   1040 <cli_putstr@plt>
mov    -0x20(%rbp),%rdi
lea    -0x3e(%rbp),%rsi
mov    $0xa,%edx
call   1060 <ustoa@plt>
lea    -0x3e(%rbp),%rdi
call   1040 <cli_putstr@plt>
lea    0xe91(%rip),%rdi
call   1040 <cli_putstr@plt>
cmpq   $0x0,-0x28(%rbp)
je     12cd <nessie_print_header+0x18d>
lea    0xe9d(%rip),%rdi
call   1040 <cli_putstr@plt>
mov    -0x28(%rbp),%rdi
lea    -0x3e(%rbp),%rsi
mov    $0xa,%edx
call   1060 <ustoa@plt>
lea    -0x3e(%rbp),%rdi
call   1040 <cli_putstr@plt>
lea    0xe53(%rip),%rdi
call   1040 <cli_putstr@plt>
cmpq   $0x0,-0x30(%rbp)
je     132c <nessie_print_header+0x1ec>
cmpq   $0xffffffffffffffff,-0x30(%rbp)
jne    12f4 <nessie_print_header+0x1b4>
lea    0xe61(%rip),%rdi
call   1040 <cli_putstr@plt>
jmp    1327 <nessie_print_header+0x1e7>
lea    0xe6d(%rip),%rdi
call   1040 <cli_putstr@plt>
mov    -0x30(%rbp),%rdi
lea    -0x3e(%rbp),%rsi
mov    $0xa,%edx
call   1060 <ustoa@plt>
lea    -0x3e(%rbp),%rdi
call   1040 <cli_putstr@plt>
lea    0xdf9(%rip),%rdi
call   1040 <cli_putstr@plt>
jmp    132c <nessie_print_header+0x1ec>
lea    0xdc7(%rip),%rdi
call   1040 <cli_putstr@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nessie_print_header>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %r9,0x10(%rsp)
mov    %r8,%r15
mov    %rcx,%r12
mov    %rdx,%r13
mov    %rsi,%rbx
mov    %rdi,%rbp
lea    0xe97(%rip),%rdi
call   1040 <cli_putstr@plt>
lea    0xf88(%rip),%rdi
call   1040 <cli_putstr@plt>
mov    %rbp,%rdi
call   1040 <cli_putstr@plt>
lea    0xf71(%rip),%rdi
call   1040 <cli_putstr@plt>
mov    %rbp,%rdi
call   1050 <strlen@plt>
cmp    $0xfffffffffffffff1,%rax
jl     11cf <nessie_print_header+0x8f>
mov    $0xffffffffffffffff,%r14
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    $0x3d,%edi
call   1030 <cli_putc@plt>
mov    %rbp,%rdi
call   1050 <strlen@plt>
add    $0xf,%rax
add    $0x1,%r14
cmp    %rax,%r14
jl     11b0 <nessie_print_header+0x70>
test   %rbx,%rbx
je     1209 <nessie_print_header+0xc9>
lea    0xf33(%rip),%rdi
call   1040 <cli_putstr@plt>
lea    0xa(%rsp),%rbp
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    $0xa,%edx
call   1060 <ustoa@plt>
mov    %rbp,%rdi
call   1040 <cli_putstr@plt>
lea    0xf17(%rip),%rdi
call   1040 <cli_putstr@plt>
test   %r13,%r13
je     1243 <nessie_print_header+0x103>
lea    0xf0c(%rip),%rdi
call   1040 <cli_putstr@plt>
lea    0xa(%rsp),%rbx
mov    %r13,%rdi
mov    %rbx,%rsi
mov    $0xa,%edx
call   1060 <ustoa@plt>
mov    %rbx,%rdi
call   1040 <cli_putstr@plt>
lea    0xedd(%rip),%rdi
call   1040 <cli_putstr@plt>
test   %r12,%r12
mov    0x10(%rsp),%rbp
je     1282 <nessie_print_header+0x142>
lea    0xedc(%rip),%rdi
call   1040 <cli_putstr@plt>
lea    0xa(%rsp),%rbx
mov    %r12,%rdi
mov    %rbx,%rsi
mov    $0xa,%edx
call   1060 <ustoa@plt>
mov    %rbx,%rdi
call   1040 <cli_putstr@plt>
lea    0xe9e(%rip),%rdi
call   1040 <cli_putstr@plt>
test   %r15,%r15
je     12bc <nessie_print_header+0x17c>
lea    0xeb0(%rip),%rdi
call   1040 <cli_putstr@plt>
lea    0xa(%rsp),%rbx
mov    %r15,%rdi
mov    %rbx,%rsi
mov    $0xa,%edx
call   1060 <ustoa@plt>
mov    %rbx,%rdi
call   1040 <cli_putstr@plt>
lea    0xe64(%rip),%rdi
call   1040 <cli_putstr@plt>
cmp    $0xffffffffffffffff,%rbp
je     12f9 <nessie_print_header+0x1b9>
test   %rbp,%rbp
je     1305 <nessie_print_header+0x1c5>
lea    0xe9a(%rip),%rdi
call   1040 <cli_putstr@plt>
lea    0xa(%rsp),%rbx
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    $0xa,%edx
call   1060 <ustoa@plt>
mov    %rbx,%rdi
call   1040 <cli_putstr@plt>
lea    0xe24(%rip),%rdi
jmp    1300 <nessie_print_header+0x1c0>
lea    0xe4b(%rip),%rdi
call   1040 <cli_putstr@plt>
lea    0xdee(%rip),%rdi
call   1040 <cli_putstr@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [253 x i8] c"\0D\0A\0D\0A********************************************************************************\0D\0A* ARM-Crypto-Lib - crypto primitives for ARM microcontrollers by Daniel Otte *\0D\0A********************************************************************************\0D\0A\0D\0A\00"
@.str.1 = [17 x i8] c"Primitive Name: \00"
@.str.2 = [3 x i8] c"\0D\0A\00"
@.str.3 = [13 x i8] c"\0D\0AKey size: \00"
@.str.4 = [6 x i8] c" bits\00"
@.str.5 = [15 x i8] c"\0D\0ABlock size: \00"
@.str.6 = [14 x i8] c"\0D\0AHash size: \00"
@.str.7 = [13 x i8] c"\0D\0AMac size: \00"
@.str.8 = [29 x i8] c"\0D\0ANo initial value (IV) mode\00"
@.str.9 = [12 x i8] c"\0D\0AIV size: \00"
define void @nessie_print_header(i8* %0, i64 %1, i64 %2, i64 %3, i64 %4, i64 %5) {
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
%12 = alloca i64
%13 = alloca i64
%14 = alloca [6 x i8]
store i8* %0, i8** %7
store i64 %1, i64* %8
store i64 %2, i64* %9
store i64 %3, i64* %10
store i64 %4, i64* %11
store i64 %5, i64* %12
%15 = call i32 @cli_putstr(i8* getelementptr inbounds ([253 x i8], [253 x i8]* @.str, i64 0, i64 0))
%16 = call i32 @cli_putstr(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%17 = load i8*, i8** %7
%18 = call i32 @cli_putstr(i8* %17)
%19 = call i32 @cli_putstr(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
store i64 0, i64* %13
br label %20
20: ; preds = %28, %6
%21 = load i64, i64* %13
%22 = load i8*, i8** %7
%23 = call i64 @strlen(i8* %22)
%24 = add nsw i64 16, %23
%25 = icmp slt i64 %21, %24
br i1 %25, label %26, label %31
26: ; preds = %20
%27 = call i32 @cli_putc(i8 signext 61)
br label %28
28: ; preds = %26
%29 = load i64, i64* %13
%30 = add nsw i64 %29, 1
store i64 %30, i64* %13
br label %20
31: ; preds = %20
%32 = load i64, i64* %8
%33 = icmp ne i64 %32, 0
br i1 %33, label %34, label %42
34: ; preds = %31
%35 = call i32 @cli_putstr(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
%36 = load i64, i64* %8
%37 = getelementptr inbounds [6 x i8], [6 x i8]* %14, i64 0, i64 0
%38 = call i32 @ustoa(i64 %36, i8* %37, i32 10)
%39 = getelementptr inbounds [6 x i8], [6 x i8]* %14, i64 0, i64 0
%40 = call i32 @cli_putstr(i8* %39)
%41 = call i32 @cli_putstr(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
br label %42
42: ; preds = %34, %31
%43 = load i64, i64* %9
%44 = icmp ne i64 %43, 0
br i1 %44, label %45, label %53
45: ; preds = %42
%46 = call i32 @cli_putstr(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0))
%47 = load i64, i64* %9
%48 = getelementptr inbounds [6 x i8], [6 x i8]* %14, i64 0, i64 0
%49 = call i32 @ustoa(i64 %47, i8* %48, i32 10)
%50 = getelementptr inbounds [6 x i8], [6 x i8]* %14, i64 0, i64 0
%51 = call i32 @cli_putstr(i8* %50)
%52 = call i32 @cli_putstr(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
br label %53
53: ; preds = %45, %42
%54 = load i64, i64* %10
%55 = icmp ne i64 %54, 0
br i1 %55, label %56, label %64
56: ; preds = %53
%57 = call i32 @cli_putstr(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0))
%58 = load i64, i64* %10
%59 = getelementptr inbounds [6 x i8], [6 x i8]* %14, i64 0, i64 0
%60 = call i32 @ustoa(i64 %58, i8* %59, i32 10)
%61 = getelementptr inbounds [6 x i8], [6 x i8]* %14, i64 0, i64 0
%62 = call i32 @cli_putstr(i8* %61)
%63 = call i32 @cli_putstr(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
br label %64
64: ; preds = %56, %53
%65 = load i64, i64* %11
%66 = icmp ne i64 %65, 0
br i1 %66, label %67, label %75
67: ; preds = %64
%68 = call i32 @cli_putstr(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0))
%69 = load i64, i64* %11
%70 = getelementptr inbounds [6 x i8], [6 x i8]* %14, i64 0, i64 0
%71 = call i32 @ustoa(i64 %69, i8* %70, i32 10)
%72 = getelementptr inbounds [6 x i8], [6 x i8]* %14, i64 0, i64 0
%73 = call i32 @cli_putstr(i8* %72)
%74 = call i32 @cli_putstr(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
br label %75
75: ; preds = %67, %64
%76 = load i64, i64* %12
%77 = icmp ne i64 %76, 0
br i1 %77, label %78, label %92
78: ; preds = %75
%79 = load i64, i64* %12
%80 = icmp eq i64 %79, -1
br i1 %80, label %81, label %83
81: ; preds = %78
%82 = call i32 @cli_putstr(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.8, i64 0, i64 0))
br label %91
83: ; preds = %78
%84 = call i32 @cli_putstr(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.9, i64 0, i64 0))
%85 = load i64, i64* %12
%86 = getelementptr inbounds [6 x i8], [6 x i8]* %14, i64 0, i64 0
%87 = call i32 @ustoa(i64 %85, i8* %86, i32 10)
%88 = getelementptr inbounds [6 x i8], [6 x i8]* %14, i64 0, i64 0
%89 = call i32 @cli_putstr(i8* %88)
%90 = call i32 @cli_putstr(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
br label %91
91: ; preds = %83, %81
br label %92
92: ; preds = %91, %75
%93 = call i32 @cli_putstr(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [253 x i8] c"\0D\0A\0D\0A********************************************************************************\0D\0A* ARM-Crypto-Lib - crypto primitives for ARM microcontrollers by Daniel Otte *\0D\0A********************************************************************************\0D\0A\0D\0A\00"
@.str.1 = [17 x i8] c"Primitive Name: \00"
@.str.2 = [3 x i8] c"\0D\0A\00"
@.str.3 = [13 x i8] c"\0D\0AKey size: \00"
@.str.4 = [6 x i8] c" bits\00"
@.str.5 = [15 x i8] c"\0D\0ABlock size: \00"
@.str.6 = [14 x i8] c"\0D\0AHash size: \00"
@.str.7 = [13 x i8] c"\0D\0AMac size: \00"
@.str.8 = [29 x i8] c"\0D\0ANo initial value (IV) mode\00"
@.str.9 = [12 x i8] c"\0D\0AIV size: \00"
define void @nessie_print_header(i8* %0, i64 %1, i64 %2, i64 %3, i64 %4, i64 %5) {
%7 = alloca [6 x i8]
%8 = tail call i32 @cli_putstr(i8* getelementptr inbounds ([253 x i8], [253 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 @cli_putstr(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%10 = tail call i32 @cli_putstr(i8* %0)
%11 = tail call i32 @cli_putstr(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%12 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%13 = icmp sgt i64 %12, -16
br i1 %13, label %14, label %21
14: ; preds = %6, %14
%15 = phi i64 [ %17, %14 ], [ 0, %6 ]
%16 = tail call i32 @cli_putc(i8 signext 61)
%17 = add nuw nsw i64 %15, 1
%18 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%19 = add nsw i64 %18, 15
%20 = icmp slt i64 %15, %19
br i1 %20, label %14, label %21
21: ; preds = %14, %6
%22 = getelementptr inbounds [6 x i8], [6 x i8]* %7, i64 0, i64 0
%23 = icmp eq i64 %1, 0
br i1 %23, label %29, label %24
24: ; preds = %21
%25 = tail call i32 @cli_putstr(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
%26 = call i32 @ustoa(i64 %1, i8* %22, i32 10)
%27 = call i32 @cli_putstr(i8* %22)
%28 = call i32 @cli_putstr(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
br label %29
29: ; preds = %24, %21
%30 = icmp eq i64 %2, 0
br i1 %30, label %36, label %31
31: ; preds = %29
%32 = call i32 @cli_putstr(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0))
%33 = call i32 @ustoa(i64 %2, i8* %22, i32 10)
%34 = call i32 @cli_putstr(i8* %22)
%35 = call i32 @cli_putstr(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
br label %36
36: ; preds = %31, %29
%37 = icmp eq i64 %3, 0
br i1 %37, label %43, label %38
38: ; preds = %36
%39 = call i32 @cli_putstr(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0))
%40 = call i32 @ustoa(i64 %3, i8* %22, i32 10)
%41 = call i32 @cli_putstr(i8* %22)
%42 = call i32 @cli_putstr(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
br label %43
43: ; preds = %38, %36
%44 = icmp eq i64 %4, 0
br i1 %44, label %50, label %45
45: ; preds = %43
%46 = call i32 @cli_putstr(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0))
%47 = call i32 @ustoa(i64 %4, i8* %22, i32 10)
%48 = call i32 @cli_putstr(i8* %22)
%49 = call i32 @cli_putstr(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
br label %50
50: ; preds = %45, %43
switch i64 %5, label %51 [
i64 0, label %58
i64 -1, label %55
]
51: ; preds = %50
%52 = call i32 @cli_putstr(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.9, i64 0, i64 0))
%53 = call i32 @ustoa(i64 %5, i8* %22, i32 10)
%54 = call i32 @cli_putstr(i8* %22)
br label %55
55: ; preds = %50, %51
%56 = phi i8* [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), %51 ], [ getelementptr inbounds ([29 x i8], [29 x i8]* @.str.8, i64 0, i64 0), %50 ]
%57 = call i32 @cli_putstr(i8* %56)
br label %58
58: ; preds = %55, %50
%59 = call i32 @cli_putstr(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
ret void
}