#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*/ put_utf8(char);
int main(void) {
  int repeat;
  int i;
  for (repeat = 0; repeat < 2; repeat++) {
    for (i = 1; i < 256; i++) {
      if (i != '\n') {
        put_utf8(i);
      }
    }
    put_utf8(0x0007ff);
    put_utf8(0x000800);
    put_utf8(0x00fffd);
    put_utf8(0x010000);
    put_utf8(0x10fffd);
    put_utf8('\n');
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    11b0 <main+0xa0>
movl   $0x1,-0xc(%rbp)
cmpl   $0x100,-0xc(%rbp)
jge    116c <main+0x5c>
cmpl   $0xa,-0xc(%rbp)
je     1159 <main+0x49>
mov    -0xc(%rbp),%eax
movsbl %al,%edi
call   1030 <put_utf8@plt>
jmp    115e <main+0x4e>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1137 <main+0x27>
mov    $0xffffffff,%edi
call   1030 <put_utf8@plt>
xor    %edi,%edi
call   1030 <put_utf8@plt>
mov    $0xfffffffd,%edi
call   1030 <put_utf8@plt>
xor    %edi,%edi
call   1030 <put_utf8@plt>
mov    $0xfffffffd,%edi
call   1030 <put_utf8@plt>
mov    $0xa,%edi
call   1030 <put_utf8@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xffffff01,%ebx
jmp    1124 <main+0x14>
nopl   0x0(%rax,%rax,1)
inc    %ebx
je     113c <main+0x2c>
cmp    $0xffffff0a,%ebx
je     1120 <main+0x10>
lea    0x100(%rbx),%eax
movsbl %al,%edi
call   1030 <put_utf8@plt>
jmp    1120 <main+0x10>
mov    $0xffffffff,%edi
call   1030 <put_utf8@plt>
xor    %edi,%edi
call   1030 <put_utf8@plt>
mov    $0xfffffffd,%edi
call   1030 <put_utf8@plt>
xor    %edi,%edi
call   1030 <put_utf8@plt>
mov    $0xfffffffd,%edi
call   1030 <put_utf8@plt>
mov    $0xa,%edi
call   1030 <put_utf8@plt>
mov    $0xffffff01,%ebx
jmp    1184 <main+0x74>
nopl   0x0(%rax)
inc    %ebx
je     119c <main+0x8c>
cmp    $0xffffff0a,%ebx
je     1180 <main+0x70>
lea    0x100(%rbx),%eax
movsbl %al,%edi
call   1030 <put_utf8@plt>
jmp    1180 <main+0x70>
mov    $0xffffffff,%edi
call   1030 <put_utf8@plt>
xor    %edi,%edi
call   1030 <put_utf8@plt>
mov    $0xfffffffd,%edi
call   1030 <put_utf8@plt>
xor    %edi,%edi
call   1030 <put_utf8@plt>
mov    $0xfffffffd,%edi
call   1030 <put_utf8@plt>
mov    $0xa,%edi
call   1030 <put_utf8@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %4
4: ; preds = %29, %0
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 2
br i1 %6, label %7, label %32
7: ; preds = %4
store i32 1, i32* %3
br label %8
8: ; preds = %19, %7
%9 = load i32, i32* %3
%10 = icmp slt i32 %9, 256
br i1 %10, label %11, label %22
11: ; preds = %8
%12 = load i32, i32* %3
%13 = icmp ne i32 %12, 10
br i1 %13, label %14, label %18
14: ; preds = %11
%15 = load i32, i32* %3
%16 = trunc i32 %15 to i8
%17 = call i32 @put_utf8(i8 signext %16)
br label %18
18: ; preds = %14, %11
br label %19
19: ; preds = %18
%20 = load i32, i32* %3
%21 = add nsw i32 %20, 1
store i32 %21, i32* %3
br label %8
22: ; preds = %8
%23 = call i32 @put_utf8(i8 signext -1)
%24 = call i32 @put_utf8(i8 signext 0)
%25 = call i32 @put_utf8(i8 signext -3)
%26 = call i32 @put_utf8(i8 signext 0)
%27 = call i32 @put_utf8(i8 signext -3)
%28 = call i32 @put_utf8(i8 signext 10)
br label %29
29: ; preds = %22
%30 = load i32, i32* %2
%31 = add nsw i32 %30, 1
store i32 %31, i32* %2
br label %4
32: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %7
%2 = phi i32 [ 1, %0 ], [ %8, %7 ]
%3 = icmp eq i32 %2, 10
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = trunc i32 %2 to i8
%6 = tail call i32 @put_utf8(i8 signext %5)
br label %7
7: ; preds = %1, %4
%8 = add nuw nsw i32 %2, 1
%9 = icmp eq i32 %8, 256
br i1 %9, label %10, label %1
10: ; preds = %7
%11 = tail call i32 @put_utf8(i8 signext -1)
%12 = tail call i32 @put_utf8(i8 signext 0)
%13 = tail call i32 @put_utf8(i8 signext -3)
%14 = tail call i32 @put_utf8(i8 signext 0)
%15 = tail call i32 @put_utf8(i8 signext -3)
%16 = tail call i32 @put_utf8(i8 signext 10)
br label %17
17: ; preds = %23, %10
%18 = phi i32 [ 1, %10 ], [ %24, %23 ]
%19 = icmp eq i32 %18, 10
br i1 %19, label %23, label %20
20: ; preds = %17
%21 = trunc i32 %18 to i8
%22 = tail call i32 @put_utf8(i8 signext %21)
br label %23
23: ; preds = %20, %17
%24 = add nuw nsw i32 %18, 1
%25 = icmp eq i32 %24, 256
br i1 %25, label %26, label %17
26: ; preds = %23
%27 = tail call i32 @put_utf8(i8 signext -1)
%28 = tail call i32 @put_utf8(i8 signext 0)
%29 = tail call i32 @put_utf8(i8 signext -3)
%30 = tail call i32 @put_utf8(i8 signext 0)
%31 = tail call i32 @put_utf8(i8 signext -3)
%32 = tail call i32 @put_utf8(i8 signext 10)
ret i32 0
}