#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 */
scalar_t__ fgets(unsigned char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printUTF8(long long);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stdin;
int strlen(unsigned char *);
long long strtoll(unsigned char *, int /*<<< orphan*/, int);
int main() {
  int i, j;
  long long n1, n2;
  unsigned char b1[15], b2[15];
  unsigned char buf[1024];
  i = 0;
  while (fgets(buf, 1024, stdin)) {
    for (i = 0; i < strlen(buf); i++)
      if (buf[i] == 'U') {
        if (buf[i + 1] == '+') {
          n1 = strtoll(buf + i + 2, 0, 16);
          printf("U+%05x", n1);
          printUTF8(n1);
          printf("|");
        }
      }
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x450,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    -0x440(%rbp),%rdi
mov    0x2e71(%rip),%rax
mov    (%rax),%edx
mov    $0x400,%esi
call   1050 <fgets@plt>
cmp    $0x0,%rax
je     125d <main+0x10d>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x444(%rbp)
lea    -0x440(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x444(%rbp),%eax
cmp    %ecx,%eax
jge    124a <main+0xfa>
movslq -0x8(%rbp),%rax
movzbl -0x440(%rbp,%rax,1),%eax
ff
cmp    $0x55,%eax
jne    1237 <main+0xe7>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
cltq
movzbl -0x440(%rbp,%rax,1),%eax
ff
cmp    $0x2b,%eax
jne    1232 <main+0xe2>
lea    -0x440(%rbp),%rdi
movslq -0x8(%rbp),%rax
add    %rax,%rdi
add    $0x2,%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1060 <strtoll@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xdec(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1070 <printUTF8@plt>
lea    0xddc(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1237 <main+0xe7>
jmp    123c <main+0xec>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1194 <main+0x44>
lea    0xdb8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1169 <main+0x19>
mov    -0x4(%rbp),%eax
add    $0x450,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x408,%rsp
mov    0x2e70(%rip),%r12
mov    (%r12),%edx
mov    %rsp,%rdi
mov    $0x400,%esi
call   1060 <fgets@plt>
test   %rax,%rax
je     1236 <main+0xd6>
lea    0x2(%rsp),%r13
mov    %rsp,%r15
lea    0xe5f(%rip),%r14
jmp    11d0 <main+0x70>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    (%r12),%edx
mov    %r15,%rdi
mov    $0x400,%esi
call   1060 <fgets@plt>
test   %rax,%rax
je     1236 <main+0xd6>
mov    %r15,%rdi
call   1040 <strlen@plt>
test   %eax,%eax
jle    11b0 <main+0x50>
xor    %ebp,%ebp
jmp    11ef <main+0x8f>
mov    %r15,%rdi
call   1040 <strlen@plt>
cltq
cmp    %rax,%rbp
jge    11b0 <main+0x50>
mov    %rbp,%rdi
add    $0x1,%rbp
cmpb   $0x55,(%rsp,%rdi,1)
jne    11e0 <main+0x80>
cmpb   $0x2b,0x1(%rsp,%rdi,1)
jne    11e0 <main+0x80>
add    %r13,%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1070 <strtoll@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1080 <printUTF8@plt>
mov    $0x7c,%edi
call   1030 <putchar@plt>
jmp    11e0 <main+0x80>
xor    %eax,%eax
add    $0x408,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stdin = global i32 0
@.str = [7 x i8] c"U+%05x\00"
@.str.1 = [2 x i8] c"|\00"
@.str.2 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i64
%5 = alloca i64
%6 = alloca [15 x i8]
%7 = alloca [15 x i8]
%8 = alloca [1024 x i8]
store i32 0, i32* %1
store i32 0, i32* %2
br label %9
9: ; preds = %52, %0
%10 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%11 = load i32, i32* @stdin
%12 = call i64 @fgets(i8* %10, i32 1024, i32 %11)
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %54
14: ; preds = %9
store i32 0, i32* %2
br label %15
15: ; preds = %49, %14
%16 = load i32, i32* %2
%17 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%18 = call i32 @strlen(i8* %17)
%19 = icmp slt i32 %16, %18
br i1 %19, label %20, label %52
20: ; preds = %15
%21 = load i32, i32* %2
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 %22
%24 = load i8, i8* %23
%25 = zext i8 %24 to i32
%26 = icmp eq i32 %25, 85
br i1 %26, label %27, label %48
27: ; preds = %20
%28 = load i32, i32* %2
%29 = add nsw i32 %28, 1
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 %30
%32 = load i8, i8* %31
%33 = zext i8 %32 to i32
%34 = icmp eq i32 %33, 43
br i1 %34, label %35, label %47
35: ; preds = %27
%36 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%37 = load i32, i32* %2
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds i8, i8* %36, i64 %38
%40 = getelementptr inbounds i8, i8* %39, i64 2
%41 = call i64 @strtoll(i8* %40, i32 0, i32 16)
store i64 %41, i64* %4
%42 = load i64, i64* %4
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i64 %42)
%44 = load i64, i64* %4
%45 = call i32 @printUTF8(i64 %44)
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %47
47: ; preds = %35, %27
br label %48
48: ; preds = %47, %20
br label %49
49: ; preds = %48
%50 = load i32, i32* %2
%51 = add nsw i32 %50, 1
store i32 %51, i32* %2
br label %15
52: ; preds = %15
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %9
54: ; preds = %9
%55 = load i32, i32* %1
ret i32 %55
}

LLVM IR (-O2):
@stdin = global i32 0
@.str = [7 x i8] c"U+%05x\00"
define i32 @main() {
%1 = alloca [1024 x i8]
%2 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%3 = load i32, i32* @stdin
%4 = call i64 @fgets(i8* %2, i32 1024, i32 %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %34, label %6
6: ; preds = %0, %29
%7 = call i32 @strlen(i8* %2)
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %29
9: ; preds = %6, %25
%10 = phi i64 [ %14, %25 ], [ 0, %6 ]
%11 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 %10
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 85
%14 = add nuw nsw i64 %10, 1
br i1 %13, label %15, label %25
15: ; preds = %9
%16 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 %14
%17 = load i8, i8* %16
%18 = icmp eq i8 %17, 43
br i1 %18, label %19, label %25
19: ; preds = %15
%20 = getelementptr inbounds i8, i8* %11, i64 2
%21 = call i64 @strtoll(i8* %20, i32 0, i32 16)
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i64 %21)
%23 = call i32 @printUTF8(i64 %21)
%24 = call i32 @putchar(i32 124)
br label %25
25: ; preds = %9, %19, %15
%26 = call i32 @strlen(i8* %2)
%27 = sext i32 %26 to i64
%28 = icmp slt i64 %14, %27
br i1 %28, label %9, label %29
29: ; preds = %25, %6
%30 = call i32 @putchar(i32 10)
%31 = load i32, i32* @stdin
%32 = call i64 @fgets(i8* %2, i32 1024, i32 %31)
%33 = icmp eq i64 %32, 0
br i1 %33, label %34, label %6
34: ; preds = %29, %0
ret i32 0
}