#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 */
size_t core_get_int_length(const int integer) {
  if (integer > 999999999) {
    return 10;
  } else if (integer > 99999999) {
    return 9;
  } else if (integer > 9999999) {
    return 8;
  } else if (integer > 999999) {
    return 7;
  } else if (integer > 99999) {
    return 6;
  } else if (integer > 9999) {
    return 5;
  } else if (integer > 999) {
    return 4;
  } else if (integer > 99) {
    return 3;
  } else if (integer > 9) {
    return 2;
  }
  return 1;
}


x86 assembly (clang, -O0):
<core_get_int_length>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
cmpl   $0x3b9ac9ff,-0xc(%rbp)
jle    1121 <core_get_int_length+0x21>
movq   $0xa,-0x8(%rbp)
jmp    121b <core_get_int_length+0x11b>
cmpl   $0x5f5e0ff,-0xc(%rbp)
jle    113b <core_get_int_length+0x3b>
movq   $0x9,-0x8(%rbp)
jmp    121b <core_get_int_length+0x11b>
cmpl   $0x98967f,-0xc(%rbp)
jle    1155 <core_get_int_length+0x55>
movq   $0x8,-0x8(%rbp)
jmp    121b <core_get_int_length+0x11b>
cmpl   $0xf423f,-0xc(%rbp)
jle    116f <core_get_int_length+0x6f>
movq   $0x7,-0x8(%rbp)
jmp    121b <core_get_int_length+0x11b>
cmpl   $0x1869f,-0xc(%rbp)
jle    1189 <core_get_int_length+0x89>
movq   $0x6,-0x8(%rbp)
jmp    121b <core_get_int_length+0x11b>
cmpl   $0x270f,-0xc(%rbp)
jle    11a3 <core_get_int_length+0xa3>
movq   $0x5,-0x8(%rbp)
jmp    121b <core_get_int_length+0x11b>
cmpl   $0x3e7,-0xc(%rbp)
jle    11bd <core_get_int_length+0xbd>
movq   $0x4,-0x8(%rbp)
jmp    121b <core_get_int_length+0x11b>
cmpl   $0x63,-0xc(%rbp)
jle    11d4 <core_get_int_length+0xd4>
movq   $0x3,-0x8(%rbp)
jmp    121b <core_get_int_length+0x11b>
cmpl   $0x9,-0xc(%rbp)
jle    11eb <core_get_int_length+0xeb>
movq   $0x2,-0x8(%rbp)
jmp    121b <core_get_int_length+0x11b>
jmp    11f0 <core_get_int_length+0xf0>
jmp    11f5 <core_get_int_length+0xf5>
jmp    11fa <core_get_int_length+0xfa>
jmp    11ff <core_get_int_length+0xff>
jmp    1204 <core_get_int_length+0x104>
jmp    1209 <core_get_int_length+0x109>
jmp    120e <core_get_int_length+0x10e>
jmp    1213 <core_get_int_length+0x113>
movq   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<core_get_int_length>:
mov    $0xa,%eax
cmp    $0x3b9ac9ff,%edi
jg     1171 <core_get_int_length+0x71>
mov    $0x9,%eax
cmp    $0x5f5e0ff,%edi
jg     1171 <core_get_int_length+0x71>
mov    $0x8,%eax
cmp    $0x98967f,%edi
jg     1171 <core_get_int_length+0x71>
mov    $0x7,%eax
cmp    $0xf423f,%edi
jg     1171 <core_get_int_length+0x71>
mov    $0x6,%eax
cmp    $0x1869f,%edi
jg     1171 <core_get_int_length+0x71>
mov    $0x5,%eax
cmp    $0x270f,%edi
jg     1171 <core_get_int_length+0x71>
mov    $0x4,%eax
cmp    $0x3e7,%edi
jg     1171 <core_get_int_length+0x71>
mov    $0x3,%eax
cmp    $0x63,%edi
jg     1171 <core_get_int_length+0x71>
xor    %eax,%eax
cmp    $0xa,%edi
setge  %al
add    $0x1,%rax
ret

LLVM IR (-O0):
define i64 @core_get_int_length(i32 %0) {
%2 = alloca i64
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sgt i32 %4, 999999999
br i1 %5, label %6, label %7
6: ; preds = %1
store i64 10, i64* %2
br label %48
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp sgt i32 %8, 99999999
br i1 %9, label %10, label %11
10: ; preds = %7
store i64 9, i64* %2
br label %48
11: ; preds = %7
%12 = load i32, i32* %3
%13 = icmp sgt i32 %12, 9999999
br i1 %13, label %14, label %15
14: ; preds = %11
store i64 8, i64* %2
br label %48
15: ; preds = %11
%16 = load i32, i32* %3
%17 = icmp sgt i32 %16, 999999
br i1 %17, label %18, label %19
18: ; preds = %15
store i64 7, i64* %2
br label %48
19: ; preds = %15
%20 = load i32, i32* %3
%21 = icmp sgt i32 %20, 99999
br i1 %21, label %22, label %23
22: ; preds = %19
store i64 6, i64* %2
br label %48
23: ; preds = %19
%24 = load i32, i32* %3
%25 = icmp sgt i32 %24, 9999
br i1 %25, label %26, label %27
26: ; preds = %23
store i64 5, i64* %2
br label %48
27: ; preds = %23
%28 = load i32, i32* %3
%29 = icmp sgt i32 %28, 999
br i1 %29, label %30, label %31
30: ; preds = %27
store i64 4, i64* %2
br label %48
31: ; preds = %27
%32 = load i32, i32* %3
%33 = icmp sgt i32 %32, 99
br i1 %33, label %34, label %35
34: ; preds = %31
store i64 3, i64* %2
br label %48
35: ; preds = %31
%36 = load i32, i32* %3
%37 = icmp sgt i32 %36, 9
br i1 %37, label %38, label %39
38: ; preds = %35
store i64 2, i64* %2
br label %48
39: ; preds = %35
br label %40
40: ; preds = %39
br label %41
41: ; preds = %40
br label %42
42: ; preds = %41
br label %43
43: ; preds = %42
br label %44
44: ; preds = %43
br label %45
45: ; preds = %44
br label %46
46: ; preds = %45
br label %47
47: ; preds = %46
store i64 1, i64* %2
br label %48
48: ; preds = %47, %38, %34, %30, %26, %22, %18, %14, %10, %6
%49 = load i64, i64* %2
ret i64 %49
}

LLVM IR (-O2):
define i64 @core_get_int_length(i32 %0) {
%2 = icmp sgt i32 %0, 999999999
br i1 %2, label %20, label %3
3: ; preds = %1
%4 = icmp sgt i32 %0, 99999999
br i1 %4, label %20, label %5
5: ; preds = %3
%6 = icmp sgt i32 %0, 9999999
br i1 %6, label %20, label %7
7: ; preds = %5
%8 = icmp sgt i32 %0, 999999
br i1 %8, label %20, label %9
9: ; preds = %7
%10 = icmp sgt i32 %0, 99999
br i1 %10, label %20, label %11
11: ; preds = %9
%12 = icmp sgt i32 %0, 9999
br i1 %12, label %20, label %13
13: ; preds = %11
%14 = icmp sgt i32 %0, 999
br i1 %14, label %20, label %15
15: ; preds = %13
%16 = icmp sgt i32 %0, 99
br i1 %16, label %20, label %17
17: ; preds = %15
%18 = icmp sgt i32 %0, 9
%19 = select i1 %18, i64 2, i64 1
br label %20
20: ; preds = %17, %15, %13, %11, %9, %7, %5, %3, %1
%21 = phi i64 [ 10, %1 ], [ 9, %3 ], [ 8, %5 ], [ 7, %7 ], [ 6, %9 ], [ 5, %11 ], [ 4, %13 ], [ 3, %15 ], [ %19, %17 ]
ret i64 %21
}