#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*/ printf(char *, long long);
void maxprint(long long value, int maxvalue) {
  if (maxvalue / 100000000000)
    printf("%12lld ", value);
  else if (maxvalue / 10000000000)
    printf("%11lld ", value);
  else if (maxvalue / 1000000000)
    printf("%10lld ", value);
  else if (maxvalue / 100000000)
    printf("%9lld ", value);
  else if (maxvalue / 10000000)
    printf("%8lld ", value);
  else if (maxvalue / 1000000)
    printf("%7lld ", value);
  else if (maxvalue / 100000)
    printf("%6lld ", value);
  else if (maxvalue / 10000)
    printf("%5lld ", value);
  else if (maxvalue / 1000)
    printf("%4lld ", value);
  else if (maxvalue / 100)
    printf("%3lld ", value);
  else
    printf("%2lld ", value);
}


x86 assembly (clang, -O0):
<maxprint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movslq -0xc(%rbp),%rax
movabs $0x174876e800,%rcx
cqto
idiv   %rcx
cmp    $0x0,%rax
je     1151 <maxprint+0x41>
mov    -0x8(%rbp),%rsi
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
jmp    1308 <maxprint+0x1f8>
movslq -0xc(%rbp),%rax
movabs $0x2540be400,%rcx
cqto
idiv   %rcx
cmp    $0x0,%rax
je     1183 <maxprint+0x73>
mov    -0x8(%rbp),%rsi
lea    0xe8f(%rip),%rdi
call   1030 <printf@plt>
jmp    1303 <maxprint+0x1f3>
mov    -0xc(%rbp),%eax
mov    $0x3b9aca00,%ecx
cltd
idiv   %ecx
cmp    $0x0,%eax
je     11ac <maxprint+0x9c>
mov    -0x8(%rbp),%rsi
lea    0xe6e(%rip),%rdi
call   1030 <printf@plt>
jmp    12fe <maxprint+0x1ee>
mov    -0xc(%rbp),%eax
mov    $0x5f5e100,%ecx
cltd
idiv   %ecx
cmp    $0x0,%eax
je     11d5 <maxprint+0xc5>
mov    -0x8(%rbp),%rsi
lea    0xe4d(%rip),%rdi
call   1030 <printf@plt>
jmp    12f9 <maxprint+0x1e9>
mov    -0xc(%rbp),%eax
mov    $0x989680,%ecx
cltd
idiv   %ecx
cmp    $0x0,%eax
je     11fe <maxprint+0xee>
mov    -0x8(%rbp),%rsi
lea    0xe2b(%rip),%rdi
call   1030 <printf@plt>
jmp    12f4 <maxprint+0x1e4>
mov    -0xc(%rbp),%eax
mov    $0xf4240,%ecx
cltd
idiv   %ecx
cmp    $0x0,%eax
je     1227 <maxprint+0x117>
mov    -0x8(%rbp),%rsi
lea    0xe09(%rip),%rdi
call   1030 <printf@plt>
jmp    12ef <maxprint+0x1df>
mov    -0xc(%rbp),%eax
mov    $0x186a0,%ecx
cltd
idiv   %ecx
cmp    $0x0,%eax
je     1250 <maxprint+0x140>
mov    -0x8(%rbp),%rsi
lea    0xde7(%rip),%rdi
call   1030 <printf@plt>
jmp    12ea <maxprint+0x1da>
mov    -0xc(%rbp),%eax
mov    $0x2710,%ecx
cltd
idiv   %ecx
cmp    $0x0,%eax
je     1279 <maxprint+0x169>
mov    -0x8(%rbp),%rsi
lea    0xdc5(%rip),%rdi
call   1030 <printf@plt>
jmp    12e5 <maxprint+0x1d5>
mov    -0xc(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
cmp    $0x0,%eax
je     12a2 <maxprint+0x192>
mov    -0x8(%rbp),%rsi
lea    0xda3(%rip),%rdi
call   1030 <printf@plt>
jmp    12e0 <maxprint+0x1d0>
mov    -0xc(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x0,%eax
je     12cb <maxprint+0x1bb>
mov    -0x8(%rbp),%rsi
lea    0xd81(%rip),%rdi
call   1030 <printf@plt>
jmp    12db <maxprint+0x1cb>
mov    -0x8(%rbp),%rsi
lea    0xd73(%rip),%rdi
call   1030 <printf@plt>
jmp    12e0 <maxprint+0x1d0>
jmp    12e5 <maxprint+0x1d5>
jmp    12ea <maxprint+0x1da>
jmp    12ef <maxprint+0x1df>
jmp    12f4 <maxprint+0x1e4>
jmp    12f9 <maxprint+0x1e9>
jmp    12fe <maxprint+0x1ee>
jmp    1303 <maxprint+0x1f3>
jmp    1308 <maxprint+0x1f8>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<maxprint>:
mov    %rdi,%rax
lea    0x3b9ac9ff(%rsi),%ecx
cmp    $0x773593fe,%ecx
ja     1198 <maxprint+0x88>
lea    0x5f5e0ff(%rsi),%ecx
cmp    $0xbebc1fe,%ecx
ja     11a7 <maxprint+0x97>
lea    0x98967f(%rsi),%ecx
cmp    $0x1312cfe,%ecx
ja     11b6 <maxprint+0xa6>
lea    0xf423f(%rsi),%ecx
cmp    $0x1e847e,%ecx
ja     11c5 <maxprint+0xb5>
lea    0x1869f(%rsi),%ecx
cmp    $0x30d3e,%ecx
ja     11d4 <maxprint+0xc4>
lea    0x270f(%rsi),%ecx
cmp    $0x4e1e,%ecx
ja     11e3 <maxprint+0xd3>
lea    0x3e7(%rsi),%ecx
cmp    $0x7ce,%ecx
ja     11f2 <maxprint+0xe2>
add    $0x63,%esi
cmp    $0xc7,%esi
lea    0xeb4(%rip),%rcx
lea    0xea6(%rip),%rdi
cmovb  %rcx,%rdi
mov    %rax,%rsi
jmp    1030 <printf@plt>
lea    0xe61(%rip),%rdi
mov    %rax,%rsi
jmp    1030 <printf@plt>
lea    0xe5a(%rip),%rdi
mov    %rax,%rsi
jmp    1030 <printf@plt>
lea    0xe52(%rip),%rdi
mov    %rax,%rsi
jmp    1030 <printf@plt>
lea    0xe4a(%rip),%rdi
mov    %rax,%rsi
jmp    1030 <printf@plt>
lea    0xe42(%rip),%rdi
mov    %rax,%rsi
jmp    1030 <printf@plt>
lea    0xe3a(%rip),%rdi
mov    %rax,%rsi
jmp    1030 <printf@plt>
lea    0xe32(%rip),%rdi
mov    %rax,%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"%12lld \00"
@.str.1 = [8 x i8] c"%11lld \00"
@.str.2 = [8 x i8] c"%10lld \00"
@.str.3 = [7 x i8] c"%9lld \00"
@.str.4 = [7 x i8] c"%8lld \00"
@.str.5 = [7 x i8] c"%7lld \00"
@.str.6 = [7 x i8] c"%6lld \00"
@.str.7 = [7 x i8] c"%5lld \00"
@.str.8 = [7 x i8] c"%4lld \00"
@.str.9 = [7 x i8] c"%3lld \00"
@.str.10 = [7 x i8] c"%2lld \00"
define void @maxprint(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = sext i32 %5 to i64
%7 = sdiv i64 %6, 100000000000
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = load i64, i64* %3
%11 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i64 %10)
br label %88
12: ; preds = %2
%13 = load i32, i32* %4
%14 = sext i32 %13 to i64
%15 = sdiv i64 %14, 10000000000
%16 = icmp ne i64 %15, 0
br i1 %16, label %17, label %20
17: ; preds = %12
%18 = load i64, i64* %3
%19 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i64 %18)
br label %87
20: ; preds = %12
%21 = load i32, i32* %4
%22 = sdiv i32 %21, 1000000000
%23 = icmp ne i32 %22, 0
br i1 %23, label %24, label %27
24: ; preds = %20
%25 = load i64, i64* %3
%26 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i64 %25)
br label %86
27: ; preds = %20
%28 = load i32, i32* %4
%29 = sdiv i32 %28, 100000000
%30 = icmp ne i32 %29, 0
br i1 %30, label %31, label %34
31: ; preds = %27
%32 = load i64, i64* %3
%33 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i64 %32)
br label %85
34: ; preds = %27
%35 = load i32, i32* %4
%36 = sdiv i32 %35, 10000000
%37 = icmp ne i32 %36, 0
br i1 %37, label %38, label %41
38: ; preds = %34
%39 = load i64, i64* %3
%40 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i64 %39)
br label %84
41: ; preds = %34
%42 = load i32, i32* %4
%43 = sdiv i32 %42, 1000000
%44 = icmp ne i32 %43, 0
br i1 %44, label %45, label %48
45: ; preds = %41
%46 = load i64, i64* %3
%47 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), i64 %46)
br label %83
48: ; preds = %41
%49 = load i32, i32* %4
%50 = sdiv i32 %49, 100000
%51 = icmp ne i32 %50, 0
br i1 %51, label %52, label %55
52: ; preds = %48
%53 = load i64, i64* %3
%54 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), i64 %53)
br label %82
55: ; preds = %48
%56 = load i32, i32* %4
%57 = sdiv i32 %56, 10000
%58 = icmp ne i32 %57, 0
br i1 %58, label %59, label %62
59: ; preds = %55
%60 = load i64, i64* %3
%61 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0), i64 %60)
br label %81
62: ; preds = %55
%63 = load i32, i32* %4
%64 = sdiv i32 %63, 1000
%65 = icmp ne i32 %64, 0
br i1 %65, label %66, label %69
66: ; preds = %62
%67 = load i64, i64* %3
%68 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), i64 %67)
br label %80
69: ; preds = %62
%70 = load i32, i32* %4
%71 = sdiv i32 %70, 100
%72 = icmp ne i32 %71, 0
br i1 %72, label %73, label %76
73: ; preds = %69
%74 = load i64, i64* %3
%75 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0), i64 %74)
br label %79
76: ; preds = %69
%77 = load i64, i64* %3
%78 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i64 0, i64 0), i64 %77)
br label %79
79: ; preds = %76, %73
br label %80
80: ; preds = %79, %66
br label %81
81: ; preds = %80, %59
br label %82
82: ; preds = %81, %52
br label %83
83: ; preds = %82, %45
br label %84
84: ; preds = %83, %38
br label %85
85: ; preds = %84, %31
br label %86
86: ; preds = %85, %24
br label %87
87: ; preds = %86, %17
br label %88
88: ; preds = %87, %9
ret void
}

LLVM IR (-O2):
@.str.2 = [8 x i8] c"%10lld \00"
@.str.3 = [7 x i8] c"%9lld \00"
@.str.4 = [7 x i8] c"%8lld \00"
@.str.5 = [7 x i8] c"%7lld \00"
@.str.6 = [7 x i8] c"%6lld \00"
@.str.7 = [7 x i8] c"%5lld \00"
@.str.8 = [7 x i8] c"%4lld \00"
@.str.9 = [7 x i8] c"%3lld \00"
@.str.10 = [7 x i8] c"%2lld \00"
define void @maxprint(i64 %0, i32 %1) {
%3 = add i32 %1, 999999999
%4 = icmp ult i32 %3, 1999999999
br i1 %4, label %5, label %27
5: ; preds = %2
%6 = add nsw i32 %1, 99999999
%7 = icmp ult i32 %6, 199999999
br i1 %7, label %8, label %27
8: ; preds = %5
%9 = add nsw i32 %1, 9999999
%10 = icmp ult i32 %9, 19999999
br i1 %10, label %11, label %27
11: ; preds = %8
%12 = add nsw i32 %1, 999999
%13 = icmp ult i32 %12, 1999999
br i1 %13, label %14, label %27
14: ; preds = %11
%15 = add nsw i32 %1, 99999
%16 = icmp ult i32 %15, 199999
br i1 %16, label %17, label %27
17: ; preds = %14
%18 = add nsw i32 %1, 9999
%19 = icmp ult i32 %18, 19999
br i1 %19, label %20, label %27
20: ; preds = %17
%21 = add nsw i32 %1, 999
%22 = icmp ult i32 %21, 1999
br i1 %22, label %23, label %27
23: ; preds = %20
%24 = add nsw i32 %1, 99
%25 = icmp ult i32 %24, 199
%26 = select i1 %25, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0)
br label %27
27: ; preds = %23, %20, %17, %14, %11, %8, %5, %2
%28 = phi i8* [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), %2 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), %5 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), %8 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), %11 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), %14 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0), %17 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), %20 ], [ %26, %23 ]
%29 = tail call i32 @printf(i8* %28, i64 %0)
ret void
}