#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*/ strncpy(char *, char *, int);
char toupper(char);
void add_double_circle(char *glyphstring) {
  char newstring[256];
  char circle[64] = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
                     0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
                     0x0, 0x0, 0x0, 0x2, 0x4, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
                     0x4, 0x2, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2, 0x4, 0x0,
                     0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
                     0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0};
  int digit1, digit2;
  int i;
  for (i = 0; i < 64; i++) {
    glyphstring[i] = toupper(glyphstring[i]);
    digit1 = (glyphstring[i] <= '9') ? (glyphstring[i] - '0')
                                     : (glyphstring[i] - 'A' + 0xA);
    digit2 = digit1 | circle[i];
    newstring[i] = (digit2 <= 9) ? ('0' + digit2) : ('A' + digit2 - 0xA);
  }
  newstring[i++] = '\n';
  newstring[i++] = '\0';
  strncpy(glyphstring, newstring, i);
  return;
}


x86 assembly (clang, -O0):
<add_double_circle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x170,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x150(%rbp),%rdi
xor    %esi,%esi
mov    $0x40,%edx
call   1050 <memset@plt>
movb   $0x2,-0x137(%rbp)
movb   $0x4,-0x136(%rbp)
movb   $0x4,-0x12f(%rbp)
movb   $0x2,-0x12e(%rbp)
movb   $0x2,-0x127(%rbp)
movb   $0x4,-0x126(%rbp)
movl   $0x0,-0x15c(%rbp)
cmpl   $0x40,-0x15c(%rbp)
jge    128d <add_double_circle+0x15d>
mov    -0x8(%rbp),%rax
movslq -0x15c(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1040 <toupper@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0x15c(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
movslq -0x15c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x39,%eax
jg     11ec <add_double_circle+0xbc>
mov    -0x8(%rbp),%rax
movslq -0x15c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
sub    $0x30,%eax
mov    %eax,-0x160(%rbp)
jmp    1207 <add_double_circle+0xd7>
mov    -0x8(%rbp),%rax
movslq -0x15c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
sub    $0x41,%eax
add    $0xa,%eax
mov    %eax,-0x160(%rbp)
mov    -0x160(%rbp),%eax
mov    %eax,-0x154(%rbp)
mov    -0x154(%rbp),%eax
movslq -0x15c(%rbp),%rcx
movsbl -0x150(%rbp,%rcx,1),%ecx
ff
or     %ecx,%eax
mov    %eax,-0x158(%rbp)
cmpl   $0x9,-0x158(%rbp)
jg     1251 <add_double_circle+0x121>
mov    -0x158(%rbp),%eax
add    $0x30,%eax
mov    %eax,-0x164(%rbp)
jmp    1263 <add_double_circle+0x133>
mov    -0x158(%rbp),%eax
add    $0x41,%eax
sub    $0xa,%eax
mov    %eax,-0x164(%rbp)
mov    -0x164(%rbp),%eax
mov    %al,%cl
movslq -0x15c(%rbp),%rax
mov    %cl,-0x110(%rbp,%rax,1)
mov    -0x15c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x15c(%rbp)
jmp    1186 <add_double_circle+0x56>
mov    -0x15c(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x15c(%rbp)
cltq
movb   $0xa,-0x110(%rbp,%rax,1)
0a
mov    -0x15c(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x15c(%rbp)
cltq
movb   $0x0,-0x110(%rbp,%rax,1)
mov    -0x8(%rbp),%rdi
lea    -0x110(%rbp),%rsi
mov    -0x15c(%rbp),%edx
call   1030 <strncpy@plt>
add    $0x170,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_double_circle>:
push   %r14
push   %rbx
sub    $0x148,%rsp
mov    %rdi,%r14
xorps  %xmm0,%xmm0
movaps %xmm0,0x10(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,(%rsp)
movw   $0x402,0x19(%rsp)
movw   $0x204,0x21(%rsp)
movw   $0x402,0x29(%rsp)
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
movsbl (%r14,%rbx,1),%edi
call   1040 <toupper@plt>
movsbl %al,%ecx
lea    -0x37(%rcx),%edx
cmp    $0x3a,%cl
lea    -0x30(%rcx),%ecx
cmovge %edx,%ecx
mov    %al,(%r14,%rbx,1)
movsbl (%rsp,%rbx,1),%eax
or     %ecx,%eax
lea    0x37(%rax),%ecx
lea    0x30(%rax),%edx
cmp    $0xa,%eax
cmovge %ecx,%edx
mov    %dl,0x40(%rsp,%rbx,1)
add    $0x1,%rbx
cmp    $0x40,%rbx
jne    1160 <add_double_circle+0x40>
movw   $0xa,0x80(%rsp)
lea    0x40(%rsp),%rsi
mov    %r14,%rdi
mov    $0x42,%edx
call   1030 <strncpy@plt>
add    $0x148,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @add_double_circle(i8* %0) {
%2 = alloca i8*
%3 = alloca [256 x i8]
%4 = alloca [64 x i8]
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %2
%8 = bitcast [64 x i8]* %4 to i8*
%9 = bitcast i8* %8 to <{ [43 x i8], [21 x i8] }>*
%10 = getelementptr inbounds <{ [43 x i8], [21 x i8] }>, <{ [43 x i8], [21 x i8] }>* %9, i32 0, i32 0
%11 = getelementptr inbounds [43 x i8], [43 x i8]* %10, i32 0, i32 25
store i8 2, i8* %11
%12 = getelementptr inbounds [43 x i8], [43 x i8]* %10, i32 0, i32 26
store i8 4, i8* %12
%13 = getelementptr inbounds [43 x i8], [43 x i8]* %10, i32 0, i32 33
store i8 4, i8* %13
%14 = getelementptr inbounds [43 x i8], [43 x i8]* %10, i32 0, i32 34
store i8 2, i8* %14
%15 = getelementptr inbounds [43 x i8], [43 x i8]* %10, i32 0, i32 41
store i8 2, i8* %15
%16 = getelementptr inbounds [43 x i8], [43 x i8]* %10, i32 0, i32 42
store i8 4, i8* %16
store i32 0, i32* %7
br label %17
17: ; preds = %79, %1
%18 = load i32, i32* %7
%19 = icmp slt i32 %18, 64
br i1 %19, label %20, label %82
20: ; preds = %17
%21 = load i8*, i8** %2
%22 = load i32, i32* %7
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i8, i8* %21, i64 %23
%25 = load i8, i8* %24
%26 = call signext i8 @toupper(i8 signext %25)
%27 = load i8*, i8** %2
%28 = load i32, i32* %7
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds i8, i8* %27, i64 %29
store i8 %26, i8* %30
%31 = load i8*, i8** %2
%32 = load i32, i32* %7
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds i8, i8* %31, i64 %33
%35 = load i8, i8* %34
%36 = sext i8 %35 to i32
%37 = icmp sle i32 %36, 57
br i1 %37, label %38, label %46
38: ; preds = %20
%39 = load i8*, i8** %2
%40 = load i32, i32* %7
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds i8, i8* %39, i64 %41
%43 = load i8, i8* %42
%44 = sext i8 %43 to i32
%45 = sub nsw i32 %44, 48
br label %55
46: ; preds = %20
%47 = load i8*, i8** %2
%48 = load i32, i32* %7
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds i8, i8* %47, i64 %49
%51 = load i8, i8* %50
%52 = sext i8 %51 to i32
%53 = sub nsw i32 %52, 65
%54 = add nsw i32 %53, 10
br label %55
55: ; preds = %46, %38
%56 = phi i32 [ %45, %38 ], [ %54, %46 ]
store i32 %56, i32* %5
%57 = load i32, i32* %5
%58 = load i32, i32* %7
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds [64 x i8], [64 x i8]* %4, i64 0, i64 %59
%61 = load i8, i8* %60
%62 = sext i8 %61 to i32
%63 = or i32 %57, %62
store i32 %63, i32* %6
%64 = load i32, i32* %6
%65 = icmp sle i32 %64, 9
br i1 %65, label %66, label %69
66: ; preds = %55
%67 = load i32, i32* %6
%68 = add nsw i32 48, %67
br label %73
69: ; preds = %55
%70 = load i32, i32* %6
%71 = add nsw i32 65, %70
%72 = sub nsw i32 %71, 10
br label %73
73: ; preds = %69, %66
%74 = phi i32 [ %68, %66 ], [ %72, %69 ]
%75 = trunc i32 %74 to i8
%76 = load i32, i32* %7
%77 = sext i32 %76 to i64
%78 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 %77
store i8 %75, i8* %78
br label %79
79: ; preds = %73
%80 = load i32, i32* %7
%81 = add nsw i32 %80, 1
store i32 %81, i32* %7
br label %17
82: ; preds = %17
%83 = load i32, i32* %7
%84 = add nsw i32 %83, 1
store i32 %84, i32* %7
%85 = sext i32 %83 to i64
%86 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 %85
store i8 10, i8* %86
%87 = load i32, i32* %7
%88 = add nsw i32 %87, 1
store i32 %88, i32* %7
%89 = sext i32 %87 to i64
%90 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 %89
store i8 0, i8* %90
%91 = load i8*, i8** %2
%92 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%93 = load i32, i32* %7
%94 = call i32 @strncpy(i8* %91, i8* %92, i32 %93)
ret void
}

LLVM IR (-O2):
define void @add_double_circle(i8* %0) {
%2 = alloca [256 x i8]
%3 = alloca [64 x i8]
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%5 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 25
store i8 2, i8* %6
%7 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 26
store i8 4, i8* %7
%8 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 33
store i8 4, i8* %8
%9 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 34
store i8 2, i8* %9
%10 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 41
store i8 2, i8* %10
%11 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 42
store i8 4, i8* %11
br label %12
12: ; preds = %1, %12
%13 = phi i64 [ 0, %1 ], [ %30, %12 ]
%14 = getelementptr inbounds i8, i8* %0, i64 %13
%15 = load i8, i8* %14
%16 = tail call signext i8 @toupper(i8 signext %15)
store i8 %16, i8* %14
%17 = sext i8 %16 to i32
%18 = icmp slt i8 %16, 58
%19 = select i1 %18, i32 -48, i32 -55
%20 = add nsw i32 %19, %17
%21 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 %13
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = or i32 %20, %23
%25 = icmp slt i32 %24, 10
%26 = select i1 %25, i32 48, i32 55
%27 = add nsw i32 %26, %24
%28 = trunc i32 %27 to i8
%29 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 %13
store i8 %28, i8* %29
%30 = add nuw nsw i64 %13, 1
%31 = icmp eq i64 %30, 64
br i1 %31, label %32, label %12
32: ; preds = %12
%33 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 64
store i8 10, i8* %33
%34 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 65
store i8 0, i8* %34
%35 = call i32 @strncpy(i8* %0, i8* %4, i32 66)
ret void
}