#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*/ getchar();
long max_size_long() {
  int i, j;
  long step, d, d_p;
  i = j = 0;
  step = d = d_p = 0;
  d = 1;
  while (d > 0) {
    ++i;
    d_p = d;
    d = d * 10;
  }
  d = d_p;
  step = d;
  while (step > 1) {
    step = step / 10;
    i = 0;
    while (d > 0) {
      d_p = d;
      d = d + step;
      ++i;
      if (i == 100)
        getchar();
    }
    d = d_p;
  }
  return d;
}


x86 assembly (clang, -O0):
<max_size_long>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x20(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x1,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jle    1170 <max_size_long+0x60>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
imul   $0xa,-0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1146 <max_size_long+0x36>
mov    -0x20(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
cmpq   $0x1,-0x10(%rbp)
jle    11ef <max_size_long+0xdf>
mov    -0x10(%rbp),%rax
mov    $0xa,%ecx
cqto
idiv   %rcx
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x4(%rbp)
cmpq   $0x0,-0x18(%rbp)
jle    11e2 <max_size_long+0xd2>
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x64,-0x4(%rbp)
jne    11dd <max_size_long+0xcd>
mov    $0x0,%al
call   1030 <getchar@plt>
jmp    11a4 <max_size_long+0x94>
mov    -0x20(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1180 <max_size_long+0x70>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define i64 @max_size_long() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i32 0, i32* %2
store i32 0, i32* %1
store i64 0, i64* %5
store i64 0, i64* %4
store i64 0, i64* %3
store i64 1, i64* %4
br label %6
6: ; preds = %9, %0
%7 = load i64, i64* %4
%8 = icmp sgt i64 %7, 0
br i1 %8, label %9, label %15
9: ; preds = %6
%10 = load i32, i32* %1
%11 = add nsw i32 %10, 1
store i32 %11, i32* %1
%12 = load i64, i64* %4
store i64 %12, i64* %5
%13 = load i64, i64* %4
%14 = mul nsw i64 %13, 10
store i64 %14, i64* %4
br label %6
15: ; preds = %6
%16 = load i64, i64* %5
store i64 %16, i64* %4
%17 = load i64, i64* %4
store i64 %17, i64* %3
br label %18
18: ; preds = %39, %15
%19 = load i64, i64* %3
%20 = icmp sgt i64 %19, 1
br i1 %20, label %21, label %41
21: ; preds = %18
%22 = load i64, i64* %3
%23 = sdiv i64 %22, 10
store i64 %23, i64* %3
store i32 0, i32* %1
br label %24
24: ; preds = %38, %21
%25 = load i64, i64* %4
%26 = icmp sgt i64 %25, 0
br i1 %26, label %27, label %39
27: ; preds = %24
%28 = load i64, i64* %4
store i64 %28, i64* %5
%29 = load i64, i64* %4
%30 = load i64, i64* %3
%31 = add nsw i64 %29, %30
store i64 %31, i64* %4
%32 = load i32, i32* %1
%33 = add nsw i32 %32, 1
store i32 %33, i32* %1
%34 = load i32, i32* %1
%35 = icmp eq i32 %34, 100
br i1 %35, label %36, label %38
36: ; preds = %27
%37 = call i32 (...) @getchar()
br label %38
38: ; preds = %36, %27
br label %24
39: ; preds = %24
%40 = load i64, i64* %5
store i64 %40, i64* %4
br label %18
41: ; preds = %18
%42 = load i64, i64* %4
ret i64 %42
}

LLVM IR (-O2):