#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 int uint8_t;
typedef int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ cli_putc(char);
int /*<<< orphan*/ cli_putstr(char *);
void nessie_print_set_vector(uint8_t set, uint16_t vector) {
  cli_putstr("\r\n\r\nSet ");
  cli_putc('0' + set % 10);
  cli_putstr(", vector#");
  cli_putc((vector < 1000) ? ' ' : '0' + vector / 1000);
  cli_putc((vector < 100) ? ' ' : '0' + (vector / 100) % 10);
  cli_putc((vector < 10) ? ' ' : '0' + (vector / 10) % 10);
  cli_putc('0' + vector % 10);
  cli_putc(':');
}


x86 assembly (clang, -O0):
<nessie_print_set_vector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    0xecb(%rip),%rdi
call   1040 <cli_putstr@plt>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    $0x30,%edx
mov    %dl,%al
movsbl %al,%edi
call   1030 <cli_putc@plt>
lea    0xeb0(%rip),%rdi
call   1040 <cli_putstr@plt>
cmpl   $0x3e8,-0x8(%rbp)
jge    1178 <nessie_print_set_vector+0x58>
mov    $0x20,%eax
mov    %eax,-0xc(%rbp)
jmp    1189 <nessie_print_set_vector+0x69>
mov    -0x8(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
add    $0x30,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
movsbl %al,%edi
call   1030 <cli_putc@plt>
cmpl   $0x64,-0x8(%rbp)
jge    11ab <nessie_print_set_vector+0x8b>
mov    $0x20,%eax
mov    %eax,-0x10(%rbp)
jmp    11c6 <nessie_print_set_vector+0xa6>
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    $0x30,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
movsbl %al,%edi
call   1030 <cli_putc@plt>
cmpl   $0xa,-0x8(%rbp)
jge    11e8 <nessie_print_set_vector+0xc8>
mov    $0x20,%eax
mov    %eax,-0x14(%rbp)
jmp    1203 <nessie_print_set_vector+0xe3>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    $0x30,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
movsbl %al,%edi
call   1030 <cli_putc@plt>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    $0x30,%edx
mov    %dl,%al
movsbl %al,%edi
call   1030 <cli_putc@plt>
mov    $0x3a,%edi
call   1030 <cli_putc@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nessie_print_set_vector>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
lea    0xed2(%rip),%rdi
call   1040 <cli_putstr@plt>
movslq %ebp,%rax
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
add    $0x30,%al
movsbl %al,%edi
call   1030 <cli_putc@plt>
lea    0xea7(%rip),%rdi
call   1040 <cli_putstr@plt>
mov    %ebx,%ebp
cmp    $0x3e8,%ebx
jge    1193 <nessie_print_set_vector+0x73>
mov    $0x20,%edi
call   1030 <cli_putc@plt>
cmp    $0x64,%ebx
jge    11a8 <nessie_print_set_vector+0x88>
mov    $0x20,%edi
call   1030 <cli_putc@plt>
mov    $0x20,%al
cmp    $0xa,%ebx
jge    11d1 <nessie_print_set_vector+0xb1>
jmp    11f6 <nessie_print_set_vector+0xd6>
imul   $0x10624dd3,%rbp,%rax
shr    $0x26,%rax
add    $0x30,%al
movsbl %al,%edi
call   1030 <cli_putc@plt>
imul   $0x51eb851f,%rbp,%rax
shr    $0x25,%rax
mov    $0xcccccccd,%ecx
imul   %rax,%rcx
shr    $0x23,%rcx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
or     $0x30,%al
movzbl %al,%edi
call   1030 <cli_putc@plt>
mov    $0xcccccccd,%eax
imul   %rax,%rbp
shr    $0x23,%rbp
mov    %rbp,%rcx
imul   %rax,%rcx
shr    $0x23,%rcx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%eax
sub    %eax,%ebp
or     $0x30,%bpl
mov    %ebp,%eax
movsbl %al,%edi
call   1030 <cli_putc@plt>
movslq %ebx,%rax
imul   $0x66666667,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x22,%rax
add    %ecx,%eax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
sub    %eax,%ebx
add    $0x30,%bl
movsbl %bl,%edi
call   1030 <cli_putc@plt>
mov    $0x3a,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <cli_putc@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"\0D\0A\0D\0ASet \00"
@.str.1 = [10 x i8] c", vector#\00"
define void @nessie_print_set_vector(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @cli_putstr(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* %3
%7 = srem i32 %6, 10
%8 = add nsw i32 48, %7
%9 = trunc i32 %8 to i8
%10 = call i32 @cli_putc(i8 signext %9)
%11 = call i32 @cli_putstr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%12 = load i32, i32* %4
%13 = icmp slt i32 %12, 1000
br i1 %13, label %14, label %15
14: ; preds = %2
br label %19
15: ; preds = %2
%16 = load i32, i32* %4
%17 = sdiv i32 %16, 1000
%18 = add nsw i32 48, %17
br label %19
19: ; preds = %15, %14
%20 = phi i32 [ 32, %14 ], [ %18, %15 ]
%21 = trunc i32 %20 to i8
%22 = call i32 @cli_putc(i8 signext %21)
%23 = load i32, i32* %4
%24 = icmp slt i32 %23, 100
br i1 %24, label %25, label %26
25: ; preds = %19
br label %31
26: ; preds = %19
%27 = load i32, i32* %4
%28 = sdiv i32 %27, 100
%29 = srem i32 %28, 10
%30 = add nsw i32 48, %29
br label %31
31: ; preds = %26, %25
%32 = phi i32 [ 32, %25 ], [ %30, %26 ]
%33 = trunc i32 %32 to i8
%34 = call i32 @cli_putc(i8 signext %33)
%35 = load i32, i32* %4
%36 = icmp slt i32 %35, 10
br i1 %36, label %37, label %38
37: ; preds = %31
br label %43
38: ; preds = %31
%39 = load i32, i32* %4
%40 = sdiv i32 %39, 10
%41 = srem i32 %40, 10
%42 = add nsw i32 48, %41
br label %43
43: ; preds = %38, %37
%44 = phi i32 [ 32, %37 ], [ %42, %38 ]
%45 = trunc i32 %44 to i8
%46 = call i32 @cli_putc(i8 signext %45)
%47 = load i32, i32* %4
%48 = srem i32 %47, 10
%49 = add nsw i32 48, %48
%50 = trunc i32 %49 to i8
%51 = call i32 @cli_putc(i8 signext %50)
%52 = call i32 @cli_putc(i8 signext 58)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"\0D\0A\0D\0ASet \00"
@.str.1 = [10 x i8] c", vector#\00"
define void @nessie_print_set_vector(i32 %0, i32 %1) {
%3 = tail call i32 @cli_putstr(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%4 = srem i32 %0, 10
%5 = trunc i32 %4 to i8
%6 = add nsw i8 %5, 48
%7 = tail call i32 @cli_putc(i8 signext %6)
%8 = tail call i32 @cli_putstr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%9 = icmp slt i32 %1, 1000
br i1 %9, label %15, label %10
10: ; preds = %2
%11 = udiv i32 %1, 1000
%12 = trunc i32 %11 to i8
%13 = add i8 %12, 48
%14 = tail call i32 @cli_putc(i8 signext %13)
br label %18
15: ; preds = %2
%16 = tail call i32 @cli_putc(i8 signext 32)
%17 = icmp slt i32 %1, 100
br i1 %17, label %24, label %18
18: ; preds = %15, %10
%19 = udiv i32 %1, 100
%20 = urem i32 %19, 10
%21 = trunc i32 %20 to i8
%22 = or i8 %21, 48
%23 = tail call i32 @cli_putc(i8 signext %22)
br label %27
24: ; preds = %15
%25 = tail call i32 @cli_putc(i8 signext 32)
%26 = icmp slt i32 %1, 10
br i1 %26, label %32, label %27
27: ; preds = %18, %24
%28 = udiv i32 %1, 10
%29 = urem i32 %28, 10
%30 = trunc i32 %29 to i8
%31 = or i8 %30, 48
br label %32
32: ; preds = %24, %27
%33 = phi i8 [ %31, %27 ], [ 32, %24 ]
%34 = tail call i32 @cli_putc(i8 signext %33)
%35 = srem i32 %1, 10
%36 = trunc i32 %35 to i8
%37 = add nsw i8 %36, 48
%38 = tail call i32 @cli_putc(i8 signext %37)
%39 = tail call i32 @cli_putc(i8 signext 58)
ret void
}