#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*/ printf(char *, int);
int main() {
  int D1732;
  int D1736;
  int i;
  int j;
  int sum;
  j = 1;
  sum = 0;
  i = 0;
  j = 1;
  goto D1728;
D1727 : {
  D1732 = j % 10;
  if (D1732 == 0)
    goto D1733;
  else
    goto D1734;
D1733:
  printf("%d", j);
  goto D1735;
D1734:
  sum = sum + i;
}
D1735:
  i = i + 1;
  j = i * 2;
D1728:
  if (i <= 99)
    goto D1727;
  else
    goto D1729;
D1729:
  printf("%d", sum);
  D1736 = 0;
  return D1736;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
jmp    1191 <main+0x81>
mov    -0x14(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    115d <main+0x4d>
jmp    1162 <main+0x52>
jmp    1176 <main+0x66>
mov    -0x14(%rbp),%esi
lea    0xe94(%rip),%rdi
call   1030 <printf@plt>
jmp    117f <main+0x6f>
mov    -0x18(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x63,-0x10(%rbp)
jg     11a0 <main+0x90>
jmp    1140 <main+0x30>
jmp    11a5 <main+0x95>
mov    -0x18(%rbp),%esi
lea    0xe51(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    $0x1,%esi
xor    %ebp,%ebp
lea    0xede(%rip),%r14
xor    %ebx,%ebx
jmp    1144 <main+0x34>
cs nopw 0x0(%rax,%rax,1)
add    %ebx,%ebp
lea    (%rbx,%rbx,1),%esi
add    $0x2,%esi
mov    %ebx,%eax
add    $0x1,%eax
mov    %eax,%ebx
cmp    $0x64,%eax
je     1157 <main+0x47>
imul   $0xffffffcd,%esi,%eax
ror    %al
cmp    $0x1a,%al
jae    1130 <main+0x20>
mov    %r14,%rdi
call   1030 <printf@plt>
jmp    1132 <main+0x22>
lea    0xea2(%rip),%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
br label %10
1: ; preds = %10
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %12)
br label %5
3: ; preds = %10
%4 = add nsw i32 %11, %13
br label %5
5: ; preds = %3, %1
%6 = phi i32 [ %11, %1 ], [ %4, %3 ]
%7 = add nuw nsw i32 %13, 1
%8 = shl nuw nsw i32 %7, 1
%9 = icmp eq i32 %7, 100
br i1 %9, label %17, label %10
10: ; preds = %0, %5
%11 = phi i32 [ 0, %0 ], [ %6, %5 ]
%12 = phi i32 [ 1, %0 ], [ %8, %5 ]
%13 = phi i32 [ 0, %0 ], [ %7, %5 ]
%14 = trunc i32 %12 to i8
%15 = urem i8 %14, 10
%16 = icmp eq i8 %15, 0
br i1 %16, label %1, label %3
17: ; preds = %5
%18 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}