#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*/ Platform_errch(unsigned char);
long long SYSTEM_MOD(long long, long long);
void Platform_errposint(long long l) {
  if (l > 10) {
    Platform_errposint(((l) >= 0 ? (l) / (10) : -(((10) - 1 - (l)) / (10))));
  }
  Platform_errch((
      unsigned char)(48 + ((l) >= 0
                               ? (l) % (10)
                               : SYSTEM_MOD((long long)(l), (long long)(10)))));
}


x86 assembly (clang, -O0):
<Platform_errposint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0xa,-0x8(%rbp)
jle    1191 <Platform_errposint+0x61>
cmpq   $0x0,-0x8(%rbp)
jl     1169 <Platform_errposint+0x39>
mov    -0x8(%rbp),%rax
mov    $0xa,%ecx
cqto
idiv   %rcx
mov    %rax,-0x10(%rbp)
jmp    1188 <Platform_errposint+0x58>
mov    $0x9,%eax
sub    -0x8(%rbp),%rax
mov    $0xa,%ecx
cqto
idiv   %rcx
mov    %rax,%rcx
xor    %eax,%eax
sub    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <Platform_errposint@plt>
cmpq   $0x0,-0x8(%rbp)
jl     11b6 <Platform_errposint+0x86>
mov    -0x8(%rbp),%rax
mov    $0xa,%ecx
cqto
idiv   %rcx
mov    %rdx,%rax
mov    %rax,-0x18(%rbp)
jmp    11c8 <Platform_errposint+0x98>
mov    -0x8(%rbp),%rdi
mov    $0xa,%esi
call   1030 <SYSTEM_MOD@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x30,%rax
movzbl %al,%edi
call   1050 <Platform_errch@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Platform_errposint>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
movabs $0xcccccccccccccccd,%r14
cc cc cc
cmp    $0xb,%rdi
jl     115b <Platform_errposint+0x2b>
mov    %rbx,%rax
mul    %r14
mov    %rdx,%rdi
shr    $0x3,%rdi
call   1040 <Platform_errposint@plt>
jmp    1160 <Platform_errposint+0x30>
test   %rbx,%rbx
js     1177 <Platform_errposint+0x47>
mov    %rbx,%rax
mul    %r14
shr    $0x2,%rdx
and    $0xfffffffffffffffe,%rdx
lea    (%rdx,%rdx,4),%rax
sub    %rax,%rbx
jmp    1187 <Platform_errposint+0x57>
mov    $0xa,%esi
mov    %rbx,%rdi
call   1030 <SYSTEM_MOD@plt>
mov    %rax,%rbx
add    $0x30,%bl
movzbl %bl,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <Platform_errch@plt>

LLVM IR (-O0):
define void @Platform_errposint(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp sgt i64 %3, 10
br i1 %4, label %5, label %18
5: ; preds = %1
%6 = load i64, i64* %2
%7 = icmp sge i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = load i64, i64* %2
%10 = sdiv i64 %9, 10
br label %16
11: ; preds = %5
%12 = load i64, i64* %2
%13 = sub nsw i64 9, %12
%14 = sdiv i64 %13, 10
%15 = sub nsw i64 0, %14
br label %16
16: ; preds = %11, %8
%17 = phi i64 [ %10, %8 ], [ %15, %11 ]
br label %18
18: ; preds = %16, %1
%19 = load i64, i64* %2
%20 = icmp sge i64 %19, 0
br i1 %20, label %21, label %24
21: ; preds = %18
%22 = load i64, i64* %2
%23 = srem i64 %22, 10
br label %27
24: ; preds = %18
%25 = load i64, i64* %2
%26 = call i64 @SYSTEM_MOD(i64 %25, i64 10)
br label %27
27: ; preds = %24, %21
%28 = phi i64 [ %23, %21 ], [ %26, %24 ]
%29 = add nsw i64 48, %28
%30 = trunc i64 %29 to i8
%31 = call i32 @Platform_errch(i8 zeroext %30)
ret void
}

LLVM IR (-O2):
define void @Platform_errposint(i64 %0) {
%2 = icmp sgt i64 %0, 10
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = udiv i64 %0, 10
tail call void @Platform_errposint(i64 %4)
br label %7
5: ; preds = %1
%6 = icmp sgt i64 %0, -1
br i1 %6, label %7, label %9
7: ; preds = %3, %5
%8 = urem i64 %0, 10
br label %11
9: ; preds = %5
%10 = tail call i64 @SYSTEM_MOD(i64 %0, i64 10)
br label %11
11: ; preds = %9, %7
%12 = phi i64 [ %8, %7 ], [ %10, %9 ]
%13 = trunc i64 %12 to i8
%14 = add i8 %13, 48
%15 = tail call i32 @Platform_errch(i8 zeroext %14)
ret void
}