#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 */
unsigned int UINT_MAX;
int is_truncatable(unsigned int);
int /*<<< orphan*/ printf(char *, unsigned int);
int main(int argc, char *argv[]) {
  unsigned sum = 0;
  unsigned count = 0;
  for (unsigned start = 11; start <= UINT_MAX; start++) {
    if (is_truncatable(start) == true) {
      sum += start++;
      count++;
    }
    if (count == 11)
      break;
  }
  printf("\nSum: %u\n", sum);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0xb,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    0x2e93(%rip),%rcx
cmp    (%rcx),%eax
ja     11aa <main+0x8a>
mov    -0x1c(%rbp),%edi
call   1040 <is_truncatable@plt>
cmp    $0x1,%eax
jne    1188 <main+0x68>
mov    -0x1c(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x1c(%rbp)
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
cmpl   $0xb,-0x18(%rbp)
jne    1197 <main+0x77>
jmp    11aa <main+0x8a>
jmp    119c <main+0x7c>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    114b <main+0x2b>
mov    -0x14(%rbp),%esi
lea    0xe4c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    0x2eba(%rip),%r14
xor    %esi,%esi
cmpl   $0xb,(%r14)
jb     116e <main+0x4e>
xor    %ebp,%ebp
mov    $0xb,%ebx
xor    %esi,%esi
nop
mov    %esi,%r15d
mov    %ebx,%edi
call   1040 <is_truncatable@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
mov    $0x0,%esi
cmove  %ebx,%esi
sete   %cl
add    %r15d,%esi
add    %ecx,%ebp
cmp    $0xb,%ebp
je     116e <main+0x4e>
add    %ecx,%ebx
add    $0x1,%ebx
cmp    (%r14),%ebx
jbe    1140 <main+0x20>
lea    0xe8b(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@UINT_MAX = global i32 0
@.str = [10 x i8] c"\0ASum: %u\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
store i32 0, i32* %7
store i32 11, i32* %8
br label %9
9: ; preds = %29, %2
%10 = load i32, i32* %8
%11 = load i32, i32* @UINT_MAX
%12 = icmp ule i32 %10, %11
br i1 %12, label %13, label %32
13: ; preds = %9
%14 = load i32, i32* %8
%15 = call i32 @is_truncatable(i32 %14)
%16 = icmp eq i32 %15, 1
br i1 %16, label %17, label %24
17: ; preds = %13
%18 = load i32, i32* %8
%19 = add i32 %18, 1
store i32 %19, i32* %8
%20 = load i32, i32* %6
%21 = add i32 %20, %18
store i32 %21, i32* %6
%22 = load i32, i32* %7
%23 = add i32 %22, 1
store i32 %23, i32* %7
br label %24
24: ; preds = %17, %13
%25 = load i32, i32* %7
%26 = icmp eq i32 %25, 11
br i1 %26, label %27, label %28
27: ; preds = %24
br label %32
28: ; preds = %24
br label %29
29: ; preds = %28
%30 = load i32, i32* %8
%31 = add i32 %30, 1
store i32 %31, i32* %8
br label %9
32: ; preds = %27, %9
%33 = load i32, i32* %6
%34 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %33)
ret i32 0
}

LLVM IR (-O2):
@UINT_MAX = global i32 0
@.str = [10 x i8] c"\0ASum: %u\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @UINT_MAX
%4 = icmp ult i32 %3, 11
br i1 %4, label %21, label %5
5: ; preds = %2, %16
%6 = phi i32 [ %18, %16 ], [ 11, %2 ]
%7 = phi i32 [ %14, %16 ], [ 0, %2 ]
%8 = phi i32 [ %12, %16 ], [ 0, %2 ]
%9 = tail call i32 @is_truncatable(i32 %6)
%10 = icmp eq i32 %9, 1
%11 = select i1 %10, i32 %6, i32 0
%12 = add i32 %11, %8
%13 = zext i1 %10 to i32
%14 = add i32 %7, %13
%15 = icmp eq i32 %14, 11
br i1 %15, label %21, label %16
16: ; preds = %5
%17 = add i32 %6, 1
%18 = add i32 %17, %13
%19 = load i32, i32* @UINT_MAX
%20 = icmp ugt i32 %18, %19
br i1 %20, label %21, label %5
21: ; preds = %16, %5, %2
%22 = phi i32 [ 0, %2 ], [ %12, %5 ], [ %12, %16 ]
%23 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %22)
ret i32 0
}