#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*/ putchar(char);
void printl(long v) {
  if (v > 999999999)
    putchar((char)(v / 1000000000) + '0');
  if (v > 99999999)
    putchar((char)((v / 100000000) % 10) + '0');
  if (v > 9999999)
    putchar((char)((v / 10000000) % 10) + '0');
  if (v > 999999)
    putchar((char)((v / 1000000) % 10) + '0');
  if (v > 99999)
    putchar((char)((v / 100000) % 10) + '0');
  if (v > 9999)
    putchar((char)((v / 10000) % 10) + '0');
  if (v > 999)
    putchar((char)((v / 1000) % 10) + '0');
  if (v > 99)
    putchar((char)((v / 100) % 10) + '0');
  if (v > 9)
    putchar((char)((v / 10) % 10) + '0');
  putchar((char)(v % 10) + '0');
}


x86 assembly (clang, -O0):
<printl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x3b9ac9ff,-0x8(%rbp)
3b
jle    1146 <printl+0x36>
mov    -0x8(%rbp),%rax
mov    $0x3b9aca00,%ecx
cqto
idiv   %rcx
movsbl %al,%eax
add    $0x30,%eax
movsbl %al,%edi
call   1030 <putchar@plt>
cmpq   $0x5f5e0ff,-0x8(%rbp)
05
jle    117c <printl+0x6c>
mov    -0x8(%rbp),%rax
mov    $0x5f5e100,%ecx
cqto
idiv   %rcx
mov    $0xa,%ecx
cqto
idiv   %rcx
mov    %dl,%al
movsbl %al,%eax
add    $0x30,%eax
movsbl %al,%edi
call   1030 <putchar@plt>
cmpq   $0x98967f,-0x8(%rbp)
jle    11b2 <printl+0xa2>
mov    -0x8(%rbp),%rax
mov    $0x989680,%ecx
cqto
idiv   %rcx
mov    $0xa,%ecx
cqto
idiv   %rcx
mov    %dl,%al
movsbl %al,%eax
add    $0x30,%eax
movsbl %al,%edi
call   1030 <putchar@plt>
cmpq   $0xf423f,-0x8(%rbp)
jle    11e8 <printl+0xd8>
mov    -0x8(%rbp),%rax
mov    $0xf4240,%ecx
cqto
idiv   %rcx
mov    $0xa,%ecx
cqto
idiv   %rcx
mov    %dl,%al
movsbl %al,%eax
add    $0x30,%eax
movsbl %al,%edi
call   1030 <putchar@plt>
cmpq   $0x1869f,-0x8(%rbp)
jle    121e <printl+0x10e>
mov    -0x8(%rbp),%rax
mov    $0x186a0,%ecx
cqto
idiv   %rcx
mov    $0xa,%ecx
cqto
idiv   %rcx
mov    %dl,%al
movsbl %al,%eax
add    $0x30,%eax
movsbl %al,%edi
call   1030 <putchar@plt>
cmpq   $0x270f,-0x8(%rbp)
jle    1254 <printl+0x144>
mov    -0x8(%rbp),%rax
mov    $0x2710,%ecx
cqto
idiv   %rcx
mov    $0xa,%ecx
cqto
idiv   %rcx
mov    %dl,%al
movsbl %al,%eax
add    $0x30,%eax
movsbl %al,%edi
call   1030 <putchar@plt>
cmpq   $0x3e7,-0x8(%rbp)
jle    128a <printl+0x17a>
mov    -0x8(%rbp),%rax
mov    $0x3e8,%ecx
cqto
idiv   %rcx
mov    $0xa,%ecx
cqto
idiv   %rcx
mov    %dl,%al
movsbl %al,%eax
add    $0x30,%eax
movsbl %al,%edi
call   1030 <putchar@plt>
cmpq   $0x63,-0x8(%rbp)
jle    12bd <printl+0x1ad>
mov    -0x8(%rbp),%rax
mov    $0x64,%ecx
cqto
idiv   %rcx
mov    $0xa,%ecx
cqto
idiv   %rcx
mov    %dl,%al
movsbl %al,%eax
add    $0x30,%eax
movsbl %al,%edi
call   1030 <putchar@plt>
cmpq   $0x9,-0x8(%rbp)
jle    12f0 <printl+0x1e0>
mov    -0x8(%rbp),%rax
mov    $0xa,%ecx
cqto
idiv   %rcx
mov    $0xa,%ecx
cqto
idiv   %rcx
mov    %dl,%al
movsbl %al,%eax
add    $0x30,%eax
movsbl %al,%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%rax
mov    $0xa,%ecx
cqto
idiv   %rcx
mov    %dl,%al
movsbl %al,%eax
add    $0x30,%eax
movsbl %al,%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printl>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
movabs $0xcccccccccccccccd,%r14
cc cc cc
cmp    $0x3b9aca00,%rdi
jl     114f <printl+0x3f>
mov    %rbx,%rax
shr    $0x9,%rax
movabs $0x44b82fa09b5a53,%rcx
mul    %rcx
shr    $0xb,%rdx
add    $0x30,%dl
movsbl %dl,%edi
call   1030 <putchar@plt>
jmp    115c <printl+0x4c>
cmp    $0x5f5e100,%rbx
jl     132b <printl+0x21b>
movabs $0xabcc77118461cefd,%rcx
77 cc ab
mov    %rbx,%rax
mul    %rcx
mov    %rdx,%rcx
shr    $0x1a,%rcx
mov    %rcx,%rax
mul    %r14
shr    $0x2,%edx
and    $0xfffffffe,%edx
lea    (%rdx,%rdx,4),%eax
sub    %eax,%ecx
or     $0x30,%cl
movzbl %cl,%edi
call   1030 <putchar@plt>
movabs $0xd6bf94d5e57a42bd,%rcx
94 bf d6
mov    %rbx,%rax
mul    %rcx
mov    %rdx,%rcx
shr    $0x17,%rcx
mov    %rcx,%rax
mul    %r14
shr    $0x2,%edx
and    $0xfffffffe,%edx
lea    (%rdx,%rdx,4),%eax
sub    %eax,%ecx
or     $0x30,%cl
movzbl %cl,%edi
call   1030 <putchar@plt>
movabs $0x431bde82d7b634db,%rcx
de 1b 43
mov    %rbx,%rax
mul    %rcx
mov    %rdx,%rcx
shr    $0x12,%rcx
mov    %rcx,%rax
mul    %r14
shr    $0x2,%edx
and    $0xfffffffe,%edx
lea    (%rdx,%rdx,4),%eax
sub    %eax,%ecx
or     $0x30,%cl
movzbl %cl,%edi
call   1030 <putchar@plt>
mov    %rbx,%rax
shr    $0x5,%rax
movabs $0xa7c5ac471b47843,%rcx
5a 7c 0a
mul    %rcx
mov    %rdx,%rcx
shr    $0x7,%rcx
mov    %rcx,%rax
mul    %r14
shr    $0x2,%edx
and    $0xfffffffe,%edx
lea    (%rdx,%rdx,4),%eax
sub    %eax,%ecx
or     $0x30,%cl
movzbl %cl,%edi
call   1030 <putchar@plt>
movabs $0x346dc5d63886594b,%rcx
c5 6d 34
mov    %rbx,%rax
mul    %rcx
mov    %rdx,%rcx
shr    $0xb,%rcx
mov    %rcx,%rax
mul    %r14
shr    $0x2,%edx
and    $0xfffffffe,%edx
lea    (%rdx,%rdx,4),%eax
sub    %eax,%ecx
or     $0x30,%cl
movzbl %cl,%edi
call   1030 <putchar@plt>
mov    %rbx,%rax
shr    $0x3,%rax
movabs $0x20c49ba5e353f7cf,%rcx
9b c4 20
mul    %rcx
mov    %rdx,%rcx
shr    $0x4,%rcx
mov    %rcx,%rax
mul    %r14
shr    $0x2,%edx
and    $0xfffffffe,%edx
lea    (%rdx,%rdx,4),%eax
sub    %eax,%ecx
or     $0x30,%cl
movzbl %cl,%edi
call   1030 <putchar@plt>
mov    %rbx,%rax
shr    $0x2,%rax
movabs $0x28f5c28f5c28f5c3,%rcx
c2 f5 28
mul    %rcx
mov    %rdx,%rcx
shr    $0x2,%rcx
mov    %rcx,%rax
mul    %r14
shr    $0x2,%edx
and    $0xfffffffe,%edx
lea    (%rdx,%rdx,4),%eax
sub    %eax,%ecx
or     $0x30,%cl
movzbl %cl,%edi
call   1030 <putchar@plt>
mov    %rbx,%rax
mul    %r14
mov    %rdx,%rcx
shr    $0x3,%rcx
mov    %rcx,%rax
mul    %r14
shr    $0x2,%edx
and    $0xfffffffe,%edx
lea    (%rdx,%rdx,4),%eax
sub    %eax,%ecx
or     $0x30,%cl
movzbl %cl,%edi
call   1030 <putchar@plt>
movabs $0x6666666666666667,%rcx
66 66 66
mov    %rbx,%rax
imul   %rcx
mov    %rdx,%rax
shr    $0x3f,%rax
shr    $0x2,%edx
add    %eax,%edx
add    %edx,%edx
lea    (%rdx,%rdx,4),%eax
sub    %eax,%ebx
add    $0x30,%bl
movsbl %bl,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <putchar@plt>
cmp    $0x989680,%rbx
jge    118f <printl+0x7f>
cmp    $0xf4240,%rbx
jge    11c2 <printl+0xb2>
cmp    $0x186a0,%rbx
jge    11f5 <printl+0xe5>
cmp    $0x2710,%rbx
jge    122c <printl+0x11c>
cmp    $0x3e8,%rbx
jge    125f <printl+0x14f>
cmp    $0x64,%rbx
jge    1296 <printl+0x186>
cmp    $0xa,%rbx
jge    12cd <printl+0x1bd>
jmp    12f6 <printl+0x1e6>

LLVM IR (-O0):
define void @printl(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp sgt i64 %3, 999999999
br i1 %4, label %5, label %13
5: ; preds = %1
%6 = load i64, i64* %2
%7 = sdiv i64 %6, 1000000000
%8 = trunc i64 %7 to i8
%9 = sext i8 %8 to i32
%10 = add nsw i32 %9, 48
%11 = trunc i32 %10 to i8
%12 = call i32 @putchar(i8 signext %11)
br label %13
13: ; preds = %5, %1
%14 = load i64, i64* %2
%15 = icmp sgt i64 %14, 99999999
br i1 %15, label %16, label %25
16: ; preds = %13
%17 = load i64, i64* %2
%18 = sdiv i64 %17, 100000000
%19 = srem i64 %18, 10
%20 = trunc i64 %19 to i8
%21 = sext i8 %20 to i32
%22 = add nsw i32 %21, 48
%23 = trunc i32 %22 to i8
%24 = call i32 @putchar(i8 signext %23)
br label %25
25: ; preds = %16, %13
%26 = load i64, i64* %2
%27 = icmp sgt i64 %26, 9999999
br i1 %27, label %28, label %37
28: ; preds = %25
%29 = load i64, i64* %2
%30 = sdiv i64 %29, 10000000
%31 = srem i64 %30, 10
%32 = trunc i64 %31 to i8
%33 = sext i8 %32 to i32
%34 = add nsw i32 %33, 48
%35 = trunc i32 %34 to i8
%36 = call i32 @putchar(i8 signext %35)
br label %37
37: ; preds = %28, %25
%38 = load i64, i64* %2
%39 = icmp sgt i64 %38, 999999
br i1 %39, label %40, label %49
40: ; preds = %37
%41 = load i64, i64* %2
%42 = sdiv i64 %41, 1000000
%43 = srem i64 %42, 10
%44 = trunc i64 %43 to i8
%45 = sext i8 %44 to i32
%46 = add nsw i32 %45, 48
%47 = trunc i32 %46 to i8
%48 = call i32 @putchar(i8 signext %47)
br label %49
49: ; preds = %40, %37
%50 = load i64, i64* %2
%51 = icmp sgt i64 %50, 99999
br i1 %51, label %52, label %61
52: ; preds = %49
%53 = load i64, i64* %2
%54 = sdiv i64 %53, 100000
%55 = srem i64 %54, 10
%56 = trunc i64 %55 to i8
%57 = sext i8 %56 to i32
%58 = add nsw i32 %57, 48
%59 = trunc i32 %58 to i8
%60 = call i32 @putchar(i8 signext %59)
br label %61
61: ; preds = %52, %49
%62 = load i64, i64* %2
%63 = icmp sgt i64 %62, 9999
br i1 %63, label %64, label %73
64: ; preds = %61
%65 = load i64, i64* %2
%66 = sdiv i64 %65, 10000
%67 = srem i64 %66, 10
%68 = trunc i64 %67 to i8
%69 = sext i8 %68 to i32
%70 = add nsw i32 %69, 48
%71 = trunc i32 %70 to i8
%72 = call i32 @putchar(i8 signext %71)
br label %73
73: ; preds = %64, %61
%74 = load i64, i64* %2
%75 = icmp sgt i64 %74, 999
br i1 %75, label %76, label %85
76: ; preds = %73
%77 = load i64, i64* %2
%78 = sdiv i64 %77, 1000
%79 = srem i64 %78, 10
%80 = trunc i64 %79 to i8
%81 = sext i8 %80 to i32
%82 = add nsw i32 %81, 48
%83 = trunc i32 %82 to i8
%84 = call i32 @putchar(i8 signext %83)
br label %85
85: ; preds = %76, %73
%86 = load i64, i64* %2
%87 = icmp sgt i64 %86, 99
br i1 %87, label %88, label %97
88: ; preds = %85
%89 = load i64, i64* %2
%90 = sdiv i64 %89, 100
%91 = srem i64 %90, 10
%92 = trunc i64 %91 to i8
%93 = sext i8 %92 to i32
%94 = add nsw i32 %93, 48
%95 = trunc i32 %94 to i8
%96 = call i32 @putchar(i8 signext %95)
br label %97
97: ; preds = %88, %85
%98 = load i64, i64* %2
%99 = icmp sgt i64 %98, 9
br i1 %99, label %100, label %109
100: ; preds = %97
%101 = load i64, i64* %2
%102 = sdiv i64 %101, 10
%103 = srem i64 %102, 10
%104 = trunc i64 %103 to i8
%105 = sext i8 %104 to i32
%106 = add nsw i32 %105, 48
%107 = trunc i32 %106 to i8
%108 = call i32 @putchar(i8 signext %107)
br label %109
109: ; preds = %100, %97
%110 = load i64, i64* %2
%111 = srem i64 %110, 10
%112 = trunc i64 %111 to i8
%113 = sext i8 %112 to i32
%114 = add nsw i32 %113, 48
%115 = trunc i32 %114 to i8
%116 = call i32 @putchar(i8 signext %115)
ret void
}

LLVM IR (-O2):
define void @printl(i64 %0) {
%2 = icmp sgt i64 %0, 999999999
br i1 %2, label %3, label %8
3: ; preds = %1
%4 = udiv i64 %0, 1000000000
%5 = trunc i64 %4 to i8
%6 = add i8 %5, 48
%7 = tail call i32 @putchar(i8 signext %6)
br label %10
8: ; preds = %1
%9 = icmp sgt i64 %0, 99999999
br i1 %9, label %10, label %16
10: ; preds = %8, %3
%11 = udiv i64 %0, 100000000
%12 = urem i64 %11, 10
%13 = trunc i64 %12 to i8
%14 = or i8 %13, 48
%15 = tail call i32 @putchar(i8 signext %14)
br label %18
16: ; preds = %8
%17 = icmp sgt i64 %0, 9999999
br i1 %17, label %18, label %24
18: ; preds = %16, %10
%19 = udiv i64 %0, 10000000
%20 = urem i64 %19, 10
%21 = trunc i64 %20 to i8
%22 = or i8 %21, 48
%23 = tail call i32 @putchar(i8 signext %22)
br label %26
24: ; preds = %16
%25 = icmp sgt i64 %0, 999999
br i1 %25, label %26, label %32
26: ; preds = %24, %18
%27 = udiv i64 %0, 1000000
%28 = urem i64 %27, 10
%29 = trunc i64 %28 to i8
%30 = or i8 %29, 48
%31 = tail call i32 @putchar(i8 signext %30)
br label %34
32: ; preds = %24
%33 = icmp sgt i64 %0, 99999
br i1 %33, label %34, label %40
34: ; preds = %32, %26
%35 = udiv i64 %0, 100000
%36 = urem i64 %35, 10
%37 = trunc i64 %36 to i8
%38 = or i8 %37, 48
%39 = tail call i32 @putchar(i8 signext %38)
br label %42
40: ; preds = %32
%41 = icmp sgt i64 %0, 9999
br i1 %41, label %42, label %48
42: ; preds = %40, %34
%43 = udiv i64 %0, 10000
%44 = urem i64 %43, 10
%45 = trunc i64 %44 to i8
%46 = or i8 %45, 48
%47 = tail call i32 @putchar(i8 signext %46)
br label %50
48: ; preds = %40
%49 = icmp sgt i64 %0, 999
br i1 %49, label %50, label %56
50: ; preds = %48, %42
%51 = udiv i64 %0, 1000
%52 = urem i64 %51, 10
%53 = trunc i64 %52 to i8
%54 = or i8 %53, 48
%55 = tail call i32 @putchar(i8 signext %54)
br label %58
56: ; preds = %48
%57 = icmp sgt i64 %0, 99
br i1 %57, label %58, label %64
58: ; preds = %56, %50
%59 = udiv i64 %0, 100
%60 = urem i64 %59, 10
%61 = trunc i64 %60 to i8
%62 = or i8 %61, 48
%63 = tail call i32 @putchar(i8 signext %62)
br label %66
64: ; preds = %56
%65 = icmp sgt i64 %0, 9
br i1 %65, label %66, label %72
66: ; preds = %58, %64
%67 = udiv i64 %0, 10
%68 = urem i64 %67, 10
%69 = trunc i64 %68 to i8
%70 = or i8 %69, 48
%71 = tail call i32 @putchar(i8 signext %70)
br label %72
72: ; preds = %66, %64
%73 = srem i64 %0, 10
%74 = trunc i64 %73 to i8
%75 = add nsw i8 %74, 48
%76 = tail call i32 @putchar(i8 signext %75)
ret void
}