#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*/ desc_digits(int);
int /*<<< orphan*/ kaprekar(int);
int /*<<< orphan*/ largest_digit(int);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int main() {
  printf("largest_digit(1234) -> %hhd\n", largest_digit(1234));
  printf("largest_digit(3253) -> %hhd\n", largest_digit(3253));
  printf("largest_digit(9800) -> %hhd\n", largest_digit(9800));
  printf("largest_digit(3333) -> %hhd\n", largest_digit(3333));
  printf("largest_digit(120) -> %hhd\n\n", largest_digit(120));
  printf("desc_digits(1234) -> %hd\n", desc_digits(1234));
  printf("desc_digits(3253) -> %hd\n", desc_digits(3253));
  printf("desc_digits(9800) -> %hd\n", desc_digits(9800));
  printf("desc_digits(3333) -> %hd\n", desc_digits(3333));
  printf("desc_digits(120) -> %hd\n\n", desc_digits(120));
  printf("kaprekar(6589) -> %lld\n", kaprekar(6589));
  printf("kaprekar(5455) -> %lld\n", kaprekar(5455));
  printf("kaprekar(6174) -> %lld\n", kaprekar(6174));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x4d2,%edi
call   1050 <largest_digit@plt>
mov    %eax,%esi
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
mov    $0xcb5,%edi
call   1050 <largest_digit@plt>
mov    %eax,%esi
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2648,%edi
call   1050 <largest_digit@plt>
mov    %eax,%esi
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
mov    $0xd05,%edi
call   1050 <largest_digit@plt>
mov    %eax,%esi
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
mov    $0x78,%edi
call   1050 <largest_digit@plt>
mov    %eax,%esi
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
mov    $0x4d2,%edi
call   1040 <desc_digits@plt>
mov    %eax,%esi
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
mov    $0xcb5,%edi
call   1040 <desc_digits@plt>
mov    %eax,%esi
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2648,%edi
call   1040 <desc_digits@plt>
mov    %eax,%esi
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
mov    $0xd05,%edi
call   1040 <desc_digits@plt>
mov    %eax,%esi
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
mov    $0x78,%edi
call   1040 <desc_digits@plt>
mov    %eax,%esi
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
mov    $0x19bd,%edi
call   1060 <kaprekar@plt>
mov    %eax,%esi
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
mov    $0x154f,%edi
call   1060 <kaprekar@plt>
mov    %eax,%esi
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
mov    $0x181e,%edi
call   1060 <kaprekar@plt>
mov    %eax,%esi
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x4d2,%edi
call   1050 <largest_digit@plt>
lea    0xeae(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0xcb5,%edi
call   1050 <largest_digit@plt>
lea    0xeb3(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x2648,%edi
call   1050 <largest_digit@plt>
lea    0xeb8(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0xd05,%edi
call   1050 <largest_digit@plt>
lea    0xebd(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x78,%edi
call   1050 <largest_digit@plt>
lea    0xec2(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x4d2,%edi
call   1040 <desc_digits@plt>
lea    0xec7(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0xcb5,%edi
call   1040 <desc_digits@plt>
lea    0xec9(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x2648,%edi
call   1040 <desc_digits@plt>
lea    0xecb(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0xd05,%edi
call   1040 <desc_digits@plt>
lea    0xecd(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x78,%edi
call   1040 <desc_digits@plt>
lea    0xecf(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x19bd,%edi
call   1060 <kaprekar@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x154f,%edi
call   1060 <kaprekar@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x181e,%edi
call   1060 <kaprekar@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [29 x i8] c"largest_digit(1234) -> %hhd\0A\00"
@.str.1 = [29 x i8] c"largest_digit(3253) -> %hhd\0A\00"
@.str.2 = [29 x i8] c"largest_digit(9800) -> %hhd\0A\00"
@.str.3 = [29 x i8] c"largest_digit(3333) -> %hhd\0A\00"
@.str.4 = [29 x i8] c"largest_digit(120) -> %hhd\0A\0A\00"
@.str.5 = [26 x i8] c"desc_digits(1234) -> %hd\0A\00"
@.str.6 = [26 x i8] c"desc_digits(3253) -> %hd\0A\00"
@.str.7 = [26 x i8] c"desc_digits(9800) -> %hd\0A\00"
@.str.8 = [26 x i8] c"desc_digits(3333) -> %hd\0A\00"
@.str.9 = [26 x i8] c"desc_digits(120) -> %hd\0A\0A\00"
@.str.10 = [24 x i8] c"kaprekar(6589) -> %lld\0A\00"
@.str.11 = [24 x i8] c"kaprekar(5455) -> %lld\0A\00"
@.str.12 = [24 x i8] c"kaprekar(6174) -> %lld\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @largest_digit(i32 1234)
%3 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = call i32 @largest_digit(i32 3253)
%5 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i32 %4)
%6 = call i32 @largest_digit(i32 9800)
%7 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i32 %6)
%8 = call i32 @largest_digit(i32 3333)
%9 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0), i32 %8)
%10 = call i32 @largest_digit(i32 120)
%11 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0), i32 %10)
%12 = call i32 @desc_digits(i32 1234)
%13 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0), i32 %12)
%14 = call i32 @desc_digits(i32 3253)
%15 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.6, i64 0, i64 0), i32 %14)
%16 = call i32 @desc_digits(i32 9800)
%17 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.7, i64 0, i64 0), i32 %16)
%18 = call i32 @desc_digits(i32 3333)
%19 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.8, i64 0, i64 0), i32 %18)
%20 = call i32 @desc_digits(i32 120)
%21 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.9, i64 0, i64 0), i32 %20)
%22 = call i32 @kaprekar(i32 6589)
%23 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.10, i64 0, i64 0), i32 %22)
%24 = call i32 @kaprekar(i32 5455)
%25 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.11, i64 0, i64 0), i32 %24)
%26 = call i32 @kaprekar(i32 6174)
%27 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.12, i64 0, i64 0), i32 %26)
ret i32 0
}

LLVM IR (-O2):
@.str = [29 x i8] c"largest_digit(1234) -> %hhd\0A\00"
@.str.1 = [29 x i8] c"largest_digit(3253) -> %hhd\0A\00"
@.str.2 = [29 x i8] c"largest_digit(9800) -> %hhd\0A\00"
@.str.3 = [29 x i8] c"largest_digit(3333) -> %hhd\0A\00"
@.str.4 = [29 x i8] c"largest_digit(120) -> %hhd\0A\0A\00"
@.str.5 = [26 x i8] c"desc_digits(1234) -> %hd\0A\00"
@.str.6 = [26 x i8] c"desc_digits(3253) -> %hd\0A\00"
@.str.7 = [26 x i8] c"desc_digits(9800) -> %hd\0A\00"
@.str.8 = [26 x i8] c"desc_digits(3333) -> %hd\0A\00"
@.str.9 = [26 x i8] c"desc_digits(120) -> %hd\0A\0A\00"
@.str.10 = [24 x i8] c"kaprekar(6589) -> %lld\0A\00"
@.str.11 = [24 x i8] c"kaprekar(5455) -> %lld\0A\00"
@.str.12 = [24 x i8] c"kaprekar(6174) -> %lld\0A\00"
define i32 @main() {
%1 = tail call i32 @largest_digit(i32 1234)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @largest_digit(i32 3253)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = tail call i32 @largest_digit(i32 9800)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i32 %5)
%7 = tail call i32 @largest_digit(i32 3333)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0), i32 %7)
%9 = tail call i32 @largest_digit(i32 120)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0), i32 %9)
%11 = tail call i32 @desc_digits(i32 1234)
%12 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0), i32 %11)
%13 = tail call i32 @desc_digits(i32 3253)
%14 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.6, i64 0, i64 0), i32 %13)
%15 = tail call i32 @desc_digits(i32 9800)
%16 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.7, i64 0, i64 0), i32 %15)
%17 = tail call i32 @desc_digits(i32 3333)
%18 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.8, i64 0, i64 0), i32 %17)
%19 = tail call i32 @desc_digits(i32 120)
%20 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.9, i64 0, i64 0), i32 %19)
%21 = tail call i32 @kaprekar(i32 6589)
%22 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.10, i64 0, i64 0), i32 %21)
%23 = tail call i32 @kaprekar(i32 5455)
%24 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.11, i64 0, i64 0), i32 %23)
%25 = tail call i32 @kaprekar(i32 6174)
%26 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.12, i64 0, i64 0), i32 %25)
ret i32 0
}